From f3ab4db625da91c8ce0fd73d35cf014df6a94b52 Mon Sep 17 00:00:00 2001 From: ccppi Date: Thu, 22 Aug 2024 11:10:11 +0200 Subject: [PATCH] 403 workaround with stealing firefox cookies for indeed.com --- lib/helpers.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/helpers.py b/lib/helpers.py index 0c4f1cd..272d9f4 100644 --- a/lib/helpers.py +++ b/lib/helpers.py @@ -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):