Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- url ='https://myip.ms/browse/comp_ip/1-294/cityID/170#1'
- response = requests.get(url).content
- soup = BeautifulSoup(response, 'html.parser')
- ipList = soup.select(".row_name")
- with open('ip_output.csv', 'w') as f:
- for ips in ipList:
- f.write(ips.find('a').text + '\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement