From b5247624b9563d82c03f846362b56eb104d774f4 Mon Sep 17 00:00:00 2001 From: ishan-surana Date: Fri, 28 Jun 2024 17:19:31 +0530 Subject: [PATCH] Made some minor adjustments --- MetaDataScraper/FacebookScraper.py | 7 +++---- MetaDataScraper/__init__.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/MetaDataScraper/FacebookScraper.py b/MetaDataScraper/FacebookScraper.py index 6bb50a9..cb71937 100644 --- a/MetaDataScraper/FacebookScraper.py +++ b/MetaDataScraper/FacebookScraper.py @@ -2,6 +2,7 @@ from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options +from selenium.webdriver.common.keys import Keys from webdriver_manager.chrome import ChromeDriverManager import time import logging @@ -9,8 +10,7 @@ class FacebookScraper: """ - A class to scrape information from a public Facebook page. - + A class to scrape information from a public Facebook page. It does not require any authentication or API keys. Attributes ---------- page_id : str @@ -55,7 +55,7 @@ class FacebookScraper: Example ------- To scrape a Facebook page: - from FacebookScraper import FacebookScraper + from MetaDataScraper import FacebookScraper scraper = FacebookScraper("page_id") @@ -113,7 +113,6 @@ def __check_page_accessibility(self): Checks if the page is accessible. If not, it quits the driver and raises an exception. """ - from selenium.webdriver.common.keys import Keys self.driver.find_element(By.TAG_NAME, "html").send_keys(Keys.TAB) self.driver.find_element(By.TAG_NAME, "html").send_keys(Keys.SHIFT + Keys.TAB) self.driver.switch_to.active_element.click() diff --git a/MetaDataScraper/__init__.py b/MetaDataScraper/__init__.py index 5d06e58..0013ba2 100644 --- a/MetaDataScraper/__init__.py +++ b/MetaDataScraper/__init__.py @@ -12,7 +12,7 @@ Classes: -------- FacebookScraper - A class to scrape followers count and post details from a public Facebook page. + A class to scrape followers count and post details from a public Facebook page. It does not require any authentication or API keys. Methods: ------------------------