Skip to content

Commit 399284b

Browse files
committed
Update logic for finding consent in url
1 parent 2047ddc commit 399284b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

yahooquery/utils/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ def setup_session(session: requests.Session, url: str = None):
13851385
response = response.result()
13861386

13871387
# check for and handle consent page:w
1388-
if response.url.find("consent"):
1388+
if response.url.find("consent") >= 0:
13891389
logger.debug(f'Redirected to consent page: "{response.url}"')
13901390

13911391
soup = BeautifulSoup(response.content, "html.parser")
@@ -1398,7 +1398,7 @@ def setup_session(session: requests.Session, url: str = None):
13981398
logger.critical(
13991399
f'Failed to find or extract "{param}" from response. Exception={exc}'
14001400
)
1401-
return
1401+
return session
14021402

14031403
logger.debug(f"params: {params}")
14041404

0 commit comments

Comments
 (0)