Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0ebac35

Browse files
committed
fix
1 parent ebb0bc6 commit 0ebac35

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎proxypool/crawlers/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def fetch(self, url, **kwargs):
2020
if response.status_code == 200:
2121
response.encoding = 'utf-8'
2222
return response.text
23-
except requests.ConnectionError:
23+
except (requests.ConnectionError, requests.ReadTimeout):
2424
return
2525

2626
def process(self, html, url):
@@ -39,6 +39,8 @@ def crawl(self):
3939
for url in self.urls:
4040
logger.info(f'fetching {url}')
4141
html = self.fetch(url)
42+
if not html:
43+
continue
4244
time.sleep(.5)
4345
yield from self.process(html, url)
4446
except RetryError:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /