Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- def GetHtml():
- r = requests.get('https://free-proxy-list.net/')
- return r.text
- def GetPageData(html):
- soup = BeautifulSoup(html, 'html.parser')
- line = soup.find('table', class_='table table-striped table-bordered').find('tbody').find_all('tr')
- for tr in line:
- td = tr.find_all('td')
- data = {'Proxy': td[0].text,
- 'Port': td[1].text,
- 'Language Code': td[2].text,
- 'Country': td[3].text,
- 'Anonymity': td[4].text,
- 'Https': td[6].text
- }
- print(str(data)[1:-1])
- GetPageData(GetHtml())
Add Comment
Please, Sign In to add comment