Created
October 18, 2020 00:42
-
-
Save RizqiEka/a4162c1a844b92999d5b2ccf2e359d57 to your computer and use it in GitHub Desktop.
ZomatoSearchPageDLV
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_dlv = [] | |
# Loop Through - Search Pages that we wanted | |
for i in range(1, 224): | |
print('Opening Search Pages ' + str(i)) | |
driver.get('https://www.zomato.com/jakarta/delivery?page={}'.format(i)) | |
print('Accessing Webpage OK \n') | |
url_elt_dlv = driver.find_elements_by_class_name("result-title") | |
# Loop Through Lists of Web Elements | |
for j in url_elt_dlv: | |
url = j.get_attribute("href") | |
out_lst_dlv.append(url) | |
driver.close() | |
# Convert List to DataFrame | |
out_dlv_df = pd.DataFrame(out_lst_dlv, columns=['Website']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment