403 workaround with stealing firefox cookies for indeed.com

This commit is contained in:
ccppi 2024-08-22 11:10:11 +02:00
parent 1a39285ed7
commit f3ab4db625

View File

@ -233,7 +233,7 @@ def getCookiesFromBrowser(url):
cmd_read_cookies = f"""SELECT name,value FROM moz_cookies WHERE host like ?;"""
print(cmd_read_cookies)
cursor = connection.cursor()
cursor.execute(cmd_read_cookies,('%'+url+'%',))
cursor.execute(cmd_read_cookies,(urlToDomain(url),))
while len(rows)!=0:
rows = cursor.fetchmany(25)
for row in rows:
@ -249,13 +249,13 @@ def getCookiesFromBrowser(url):
def urlToDomain(url):
pos = patternSearch(url,"https://")
urlCut = dropBeforePos(url,pos)
print("url cut",urlCut)
posDot = skipAfterChar(urlCut,'.')
posDot = skipAfterChar(urlCut,'.') - 1
urlCut = dropBeforePos(urlCut,posDot)
print("url after cut dot:",urlCut)
posDot = skipAfterChar(urlCut,'.')
posDot = skipAfterChar(urlCut,'/')
urlCut = dropAfterPos(urlCut,posDot)
print("url after cut dot:",urlCut)
return urlCut
def patternSearch(url,pattern):
x = 0
for a,i in enumerate(url):