Skip to content

Commit

Permalink
Merge pull request #772 from NielsOerbaek/master
Browse files Browse the repository at this point in the history
make get_page_info also extract page name
  • Loading branch information
neon-ninja authored Jun 13, 2022
2 parents 1424338 + 2bb34ac commit 947c056
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions facebook_scraper/facebook_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ def get_page_info(self, page, **kwargs) -> Profile:
about_url = f'/{page}/about/'
logger.debug(f"Requesting page from: {about_url}")
resp = self.get(about_url)
result["name"] = resp.html.find("title", first=True).text.replace(" - About", "")
desc = resp.html.find("meta[name='description']", first=True)
result["about"] = resp.html.find(
'#pages_msite_body_contents,div.aboutme', first=True
Expand All @@ -623,6 +624,7 @@ def get_page_info(self, page, **kwargs) -> Profile:
url = f'/{page}/'
logger.debug(f"Requesting page from: {url}")
resp = self.get(url)
result["name"] = resp.html.find("title", first=True).text.replace(" - Home", "")
desc = resp.html.find("meta[name='description']", first=True)
ld_json = None
try:
Expand Down

0 comments on commit 947c056

Please sign in to comment.