Skip to content

Commit e446b57

Browse files
committed
driver path input from user
1 parent ead6f83 commit e446b57

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Dev.to Scraper/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ pip install -r requirements.txt
88
```
99
As this script uses selenium, you will need to install the chrome webdriver from [this link](https://sites.google.com/a/chromium.org/chromedriver/downloads)
1010

11-
Once the installation is complete, you need to add the webdriver in the path in the following line:
12-
```
13-
driver = webdriver.Chrome('<Path to chrome webdriver >')
14-
```
15-
1611
After satisfying all the requirements for the project, Open the terminal in the project folder and run
1712
```
1813
python scraper.py

Dev.to Scraper/scraper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
# Get input for category and number of articles
99
category = input("Enter category: ")
1010
number_articles = int(input("Enter number of articles: "))
11+
driver_path = input("Enter chrome driver path: ")
1112

1213
url = 'https://dev.to/search?q={}'.format(category)
1314

1415
# initiating the webdriver. Parameter includes the path of the webdriver.
15-
driver = webdriver.Chrome('C:\Webdrivers\chromedriver')
16+
driver = webdriver.Chrome(driver_path)
1617
driver.get(url)
1718

1819
# this is just to ensure that the page is loaded

0 commit comments

Comments
 (0)