Last active
October 18, 2020 00:48
-
-
Save RizqiEka/8da1ba5506effe16c26ae9ca87431e6a to your computer and use it in GitHub Desktop.
ZoRestPrice
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
#Restaurant Price for 2 | |
try: | |
price_for_2_anchor = driver.find_element_by_xpath("""/html/body/div[1]/div[2]/main/div/section[4]/section/section/article[1]/section[2]/p[1]""") | |
price_for_2_text = price_for_2_anchor.text | |
except NoSuchElementException: | |
price_for_2_text = "No Price Data Found" | |
pass | |
if (price_for_2_text[0:2] == 'Rp') or (price_for_2_text[0:2] == 'No'): | |
price_for_2.append(price_for_2_text) | |
else: | |
price_for_2_anchor = driver.find_element_by_xpath("""/html/body/div[1]/div[2]/main/div/section[4]/section/section/article[1]/section[2]/p[2]""") | |
price_for_2_text = price_for_2_anchor.text | |
if (price_for_2_text[0:2] == 'Rp') or (price_for_2_text[0:2] == 'No'): | |
price_for_2.append(price_for_2_text) | |
else: | |
price_for_2_anchor = driver.find_element_by_xpath("""/html/body/div[1]/div[2]/main/div/section[4]/section/section/article[1]/section[2]/p[3]""") | |
price_for_2_text = price_for_2_anchor.text | |
price_for_2.append(price_for_2_text) | |
print(f'Scraping Restaurant Price for Two - {name} - {price_for_2_text} - OK') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment