I am following this build of a scraper for LinkedIn job data.
Here is my code:
from selenium import webdriver
import time
import pandas as pd
url = 'https://www.linkedin.com/jobs/search?keywords=&location=San%20Francisco%2C%20California%2C%20United%20States&locationId=&geoId=102277331&f_TPR=&distance=100&position=1&pageNum=0'
wd = webdriver.Chrome(executable_path=r'/Users/voi/chromedriver')
wd.get(url)
no_of_jobs = int(wd.driver.find_element_by_css_selector('h1>span').get_attribute('innerText'))
I have seen this, and attempted the solution, but received a similar error, except with regards to the WebDriver object not having a driver attribute.
Here is the full error message:
cd /Users/voi ; /usr/bin/env /usr/local/bin/python3 /Users/voi/.vscode/extensions/ms-python.python-2
022.8.1/pythonFiles/lib/python/debugpy/launcher 59402 -- /Users/voi/jobscrape.py
/Users/voi/jobscrape.py:7: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
wd = webdriver.Chrome(executable_path=r'/Users/voi/chromedriver')
Traceback (most recent call last):
File "/Users/voi/jobscrape.py", line 10, in <module>
no_of_jobs = int(wd.find_element_by_css_selector('h1>span').get_attribute('innerText'))
AttributeError: 'WebDriver' object has no attribute 'find_element_by_css_selector'
DeprecationWarning
to resolve this you can see this [https://mcmap.net/q/219571/-deprecationwarning-with-selenium-geckodriver] , hope this will help you. – Sanious