Work around a bug in python requests.
This commit is contained in:
parent
14f0a6fe78
commit
a35c54525d
1 changed files with 4 additions and 0 deletions
|
@ -101,6 +101,10 @@ def getPageContent(url, max_content_bytes=MaxContentBytes, session=None):
|
|||
# read page data
|
||||
page = urlopen(url, max_content_bytes=max_content_bytes, session=session)
|
||||
data = page.text
|
||||
if not data:
|
||||
# sometimes the python requests library is wonky - try again
|
||||
page = urlopen(url, max_content_bytes=max_content_bytes, session=session)
|
||||
data = page.text
|
||||
# determine base URL
|
||||
baseUrl = None
|
||||
match = baseSearch.search(data)
|
||||
|
|
Loading…
Reference in a new issue