Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'WebDriver' object has no attribute 'find_element_by_css_selector' in "ProfileScraper.py" #110

Open
Tarunika03 opened this issue Sep 19, 2024 · 2 comments

Comments

@Tarunika03
Copy link

in ProfileScraper.get_profile(self)
91 def get_profile(self):
92 try:
---> 93 profile = self.driver.find_element_by_css_selector(
94 self.MAIN_SELECTOR).get_attribute("outerHTML")
95 except Exception as e:
96 logger.exception(
97 "Could not find profile wrapper html. This sometimes happens for exceptionally long profiles. Try decreasing scroll-increment. The actual error was: %s", e)

AttributeError: 'WebDriver' object has no attribute 'find_element_by_css_selector'

@Tarunika03
Copy link
Author

In the "ProfileScraper.py" file, need to:

Replace

self.driver.find_element_by_css_selector(self.MAIN_SELECTOR)

With

self.driver.find_element(By.CSS_SELECTOR, self.MAIN_SELECTOR)

@yankun2024
Copy link

"2024? !! Can these codes still be used out of the box?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants