Skip to content

Instantly share code, notes, and snippets.

View RizqiEka's full-sized avatar

Rizqi Eka Maulana RizqiEka

View GitHub Profile
@RizqiEka
RizqiEka / ZomatoSearchPage.py
Created October 18, 2020 00:40
ZomatoSearchPage
# 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")
@RizqiEka
RizqiEka / BasicZomatoSearchPage.py
Created October 18, 2020 00:39
BasicZomatoSearchPage
# Set Webdriver
driver = webdriver.Chrome(chromepath)
out_lst = []
# Loop Through Search Pages that we wanted
for i in range(1, 1003):
driver.get('https://www.zomato.com/jakarta/restoran?page={}'.format(i))
url_elt = driver.find_elements_by_class_name("result-title")
@RizqiEka
RizqiEka / LoopThroughWebElements.py
Created October 18, 2020 00:37
LoopThroughWebElements
out_lst = []
for j in url_elt:
url = j.get_attribute("href")
out_lst.append(url)
@RizqiEka
RizqiEka / SeleniumPreparation.py
Created October 18, 2020 00:33
SeleniumPreparation
from selenium import webdriver
# Set Windows path where WebDriver is located -> to be used for Selenium
chromepath = r'C:\Users\Downloads\chromedriver_win32\chromedriver.exe'