Advertisement
skip420

ipscraper2

Feb 21st, 2022 (edited)
790
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3. url ='https://myip.ms/browse/comp_ip/1-294/cityID/170#1'
  4. response = requests.get(url).content
  5. soup = BeautifulSoup(response, 'html.parser')
  6. ipList = soup.select(".row_name")
  7. with open('ip_output.csv', 'w') as f:
  8.     for ips in ipList:
  9.         f.write(ips.find('a').text + '\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement