Skip to content

Instantly share code, notes, and snippets.

@RizqiEka
Created October 18, 2020 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RizqiEka/a4162c1a844b92999d5b2ccf2e359d57 to your computer and use it in GitHub Desktop.
Save RizqiEka/a4162c1a844b92999d5b2ccf2e359d57 to your computer and use it in GitHub Desktop.
ZomatoSearchPageDLV
# 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