Skip to content

Commit

Permalink
Merge pull request #19 from bhaskar-29/master
Browse files Browse the repository at this point in the history
Thanks for the contribution!
  • Loading branch information
chuanenlin authored Oct 1, 2020
2 parents 6ef24c0 + cf60bcf commit edbf3c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions shutterscrape.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager #use to initialize driver in a better way without having chromedriver path mentioned.
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
Expand Down Expand Up @@ -33,7 +34,7 @@ def inp(text):

def videoscrape():
try:
driver = webdriver.Chrome()
driver = webdriver.Chrome(ChromeDriverManager().install()) #This installs or finds the new version of chrome driver if not available and links to path automatically.
driver.maximize_window()
for i in range(1, searchPage + 1):
url = "https://www.shutterstock.com/video/search/" + searchTerm + "?page=" + str(i)
Expand Down Expand Up @@ -76,7 +77,7 @@ def imagescrape():
try:
chrome_options = Options()
chrome_options.add_argument("--no-sandbox")
driver = webdriver.Chrome(chrome_options=chrome_options)
driver = webdriver.Chrome(ChromeDriverManager().install(), chrome_options=chrome_options)
driver.maximize_window()
for i in range(1, searchPage + 1):
url = "https://www.shutterstock.com/search?searchterm=" + searchTerm + "&sort=popular&image_type=" + image_type + "&search_source=base_landing_page&language=en&page=" + str(i)
Expand Down

0 comments on commit edbf3c7

Please sign in to comment.