Created
October 18, 2020 00:40
-
-
Save RizqiEka/513b4e4ee7888df37b9fed76f77d20ca to your computer and use it in GitHub Desktop.
ZomatoSearchPage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set Webdriver | |
driver = webdriver.Chrome(chromepath) | |
out_lst = [] | |
# Loop Through Search Pages that we wanted | |
for i in range(1, 1003): | |
print('Opening Search Pages ' + str(i)) | |
driver.get('https://www.zomato.com/jakarta/restoran?page={}'.format(i)) | |
print('Accessing Webpage OK \n') | |
url_elt = driver.find_elements_by_class_name("result-title") | |
# Loop Through Lists of Web Elements | |
for j in url_elt: | |
url = j.get_attribute("href") | |
out_lst.append(url) | |
driver.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment