mirror of
https://github.com/bellingcat/snscrape.git
synced 2026-06-13 04:48:28 +03:00
Fix a few f-strings
This commit is contained in:
@@ -172,7 +172,7 @@ class Scraper:
|
|||||||
logger.info(f'Retrieved {req.url}{redirected}: {r.status_code}')
|
logger.info(f'Retrieved {req.url}{redirected}: {r.status_code}')
|
||||||
if r.history:
|
if r.history:
|
||||||
for i, redirect in enumerate(r.history):
|
for i, redirect in enumerate(r.history):
|
||||||
logger.debug('... request {i}: {redirect.request.url}: {r.status_code} (Location: {r.headers.get("Location")})')
|
logger.debug(f'... request {i}: {redirect.request.url}: {r.status_code} (Location: {r.headers.get("Location")})')
|
||||||
if responseOkCallback is not None:
|
if responseOkCallback is not None:
|
||||||
success, msg = responseOkCallback(r)
|
success, msg = responseOkCallback(r)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ class FacebookUserAndCommunityScraper(FacebookCommonScraper):
|
|||||||
logger.info('Retrieving initial data')
|
logger.info('Retrieving initial data')
|
||||||
r = self._get(self._baseUrl, headers = self._headers)
|
r = self._get(self._baseUrl, headers = self._headers)
|
||||||
if r.status_code not in (200, 404):
|
if r.status_code not in (200, 404):
|
||||||
raise snscrape.base.ScraperException('Got status code {r.status_code}')
|
raise snscrape.base.ScraperException(f'Got status code {r.status_code}')
|
||||||
self._initialPage = r
|
self._initialPage = r
|
||||||
self._initialPageSoup = bs4.BeautifulSoup(r.text, 'lxml')
|
self._initialPageSoup = bs4.BeautifulSoup(r.text, 'lxml')
|
||||||
return self._initialPage, self._initialPageSoup
|
return self._initialPage, self._initialPageSoup
|
||||||
@@ -316,7 +316,7 @@ class FacebookGroupScraper(FacebookCommonScraper):
|
|||||||
logger.warning('Group does not exist')
|
logger.warning('Group does not exist')
|
||||||
return
|
return
|
||||||
elif r.status_code != 200:
|
elif r.status_code != 200:
|
||||||
raise snscrape.base.ScraperException('Got status code {r.status_code}')
|
raise snscrape.base.ScraperException(f'Got status code {r.status_code}')
|
||||||
|
|
||||||
if 'content:{pagelet_group_mall:{container_id:"' not in r.text:
|
if 'content:{pagelet_group_mall:{container_id:"' not in r.text:
|
||||||
raise snscrape.base.ScraperException('Code container ID marker not found (does the group exist?)')
|
raise snscrape.base.ScraperException('Code container ID marker not found (does the group exist?)')
|
||||||
|
|||||||
Reference in New Issue
Block a user