-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_proxy_list.py
More file actions
39 lines (29 loc) · 1.05 KB
/
get_proxy_list.py
File metadata and controls
39 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import requests
from bs4 import BeautifulSoup
import pandas as pd
all_p = []
search_string = input("enter search query : ")
search_string.replace(' ', '+')
url = f'https://www.google.com/search?q={search_string}'
headers = {
'User-agent':
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.19582"
}
all_data = [a.find('a').find('h3').text for a in BeautifulSoup(requests.get(url, headers=headers).text, 'lxml').find_all('div', class_='yuRUbf')]
print(all_data)
# for i in all_data:
# try:
# proxies = {
# 'ip-address' : i.find_all('td')[0].text,
# 'port' : i.find_all('td')[1].text,
# 'code' : i.find_all('td')[2].text,
# 'country' : i.find_all('td')[3].text,
# 'anonimity' : i.find_all('td')[4].text,
# 'Https' : i.find_all('td')[6].text,
# }
# all_p.append(proxies)
# print(proxies)
# except:
# print('')
# df = pd.DataFrame(all_p)
# df.to_json('all_proxies.json')