403 workaround with stealing firefox cookies for indeed.com
This commit is contained in:
parent
1a39285ed7
commit
f3ab4db625
@ -233,7 +233,7 @@ def getCookiesFromBrowser(url):
|
|||||||
cmd_read_cookies = f"""SELECT name,value FROM moz_cookies WHERE host like ?;"""
|
cmd_read_cookies = f"""SELECT name,value FROM moz_cookies WHERE host like ?;"""
|
||||||
print(cmd_read_cookies)
|
print(cmd_read_cookies)
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
cursor.execute(cmd_read_cookies,('%'+url+'%',))
|
cursor.execute(cmd_read_cookies,(urlToDomain(url),))
|
||||||
while len(rows)!=0:
|
while len(rows)!=0:
|
||||||
rows = cursor.fetchmany(25)
|
rows = cursor.fetchmany(25)
|
||||||
for row in rows:
|
for row in rows:
|
||||||
@ -249,13 +249,13 @@ def getCookiesFromBrowser(url):
|
|||||||
def urlToDomain(url):
|
def urlToDomain(url):
|
||||||
pos = patternSearch(url,"https://")
|
pos = patternSearch(url,"https://")
|
||||||
urlCut = dropBeforePos(url,pos)
|
urlCut = dropBeforePos(url,pos)
|
||||||
print("url cut",urlCut)
|
posDot = skipAfterChar(urlCut,'.') - 1
|
||||||
posDot = skipAfterChar(urlCut,'.')
|
|
||||||
urlCut = dropBeforePos(urlCut,posDot)
|
urlCut = dropBeforePos(urlCut,posDot)
|
||||||
print("url after cut dot:",urlCut)
|
posDot = skipAfterChar(urlCut,'/')
|
||||||
posDot = skipAfterChar(urlCut,'.')
|
|
||||||
urlCut = dropAfterPos(urlCut,posDot)
|
urlCut = dropAfterPos(urlCut,posDot)
|
||||||
print("url after cut dot:",urlCut)
|
print("url after cut dot:",urlCut)
|
||||||
|
return urlCut
|
||||||
|
|
||||||
def patternSearch(url,pattern):
|
def patternSearch(url,pattern):
|
||||||
x = 0
|
x = 0
|
||||||
for a,i in enumerate(url):
|
for a,i in enumerate(url):
|
||||||
|
Loading…
Reference in New Issue
Block a user