123456789101112131415161718 |
- # Get the first 20 hits for: "Breaking Code" WordPress blog
- from googlesearch import search
- import dataset
- import time
- db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/hhh?charset=utf8mb4')
- table=db['backlinks']
- #for url in search('link:https://www.searchome.net/ -site:searchome.net', num_results=100):
- #for url in search('link:https://www.searchome.net/ -site:searchome.net', 10):
- #for url in search('link:https://www.searchome.net/ -site:searchome.net 2020..2021',start=70,stop=1000):
- for url in search('link:https://www.searchome.net/ -site:searchome.net 2020..2021',stop=1000):
- try:
- table.insert({'url':url})
- time.sleep(4)
- except:
- print('except')
- print(url)
|