Open funnyway opened 6 years ago
from newspaper.configuration import Configuration
from bs4 import BeautifulSoup
PROXIES = {
'http': "",
'https': ""
}
USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"
config = Configuration()
config.proxies = PROXIES
articles_two = Article(URL_FOR_IP, config=config)
articles_two.download()
html_two = BeautifulSoup(articles_two.html, 'lxml')
print(html_two.find('div', {"id": 'ipv4'}).get_text())
I hope it helped!
How do I use proxy IP?