wait between scrapping requests, avoid triggering captcha interception

This commit is contained in:
Sam Hadow 2024-03-01 14:59:38 +01:00
parent bdcef0911d
commit fc9b313832

View File

@ -1,5 +1,5 @@
#!/usr/bin/python #!/usr/bin/python
import requests, re, json, os, yaml import requests, re, json, os, yaml, time
from db import * from db import *
def load_cookies_from_file(file_path): def load_cookies_from_file(file_path):
@ -98,6 +98,7 @@ def update_items():
'''add new history entries for items in database''' '''add new history entries for items in database'''
in_db = get_item_keys() in_db = get_item_keys()
for item in in_db: for item in in_db:
time.sleep(2)
new_entry = check_item(item) new_entry = check_item(item)
fill_db(new_entry) fill_db(new_entry)