|
@@ -218,7 +218,7 @@ def get_reviews(driver, output):
|
|
|
ActionChains(driver).move_to_element(element).click(element).perform()
|
|
|
time.sleep(0.5)
|
|
|
|
|
|
- page_down_(driver, "//div[@class='siAUzd-neVct siAUzd-neVct-H9tDt']", 10)
|
|
|
+ page_down_(driver, '//*[@id="pane"]/div/div[1]/div/div/div[2]/div[1]', 5)
|
|
|
all_photo = driver.find_elements_by_class_name('ODSEW-ShBeI-xJzy8c-bF1uUb')
|
|
|
for ap in all_photo:
|
|
|
ap.click()
|
|
@@ -383,10 +383,13 @@ def time_click(driver):
|
|
|
status = '正常'
|
|
|
|
|
|
except NoSuchElementException:
|
|
|
- time_css = "div[aria-expanded='false']"
|
|
|
- elem = driver.find_element_by_css_selector(time_css)
|
|
|
- if elem:
|
|
|
- status = '暫時關閉'
|
|
|
+ try:
|
|
|
+ time_css = "div[aria-expanded='false']"
|
|
|
+ elem = driver.find_element_by_css_selector(time_css)
|
|
|
+ if elem:
|
|
|
+ status = '暫時關閉'
|
|
|
+ except:
|
|
|
+ return ''
|
|
|
return status
|
|
|
|
|
|
|
|
@@ -454,10 +457,7 @@ def page_down_(driver, xpath_css, time_):
|
|
|
|
|
|
|
|
|
def main():
|
|
|
- keyword = '咖啡'
|
|
|
db = DA.mysql_connect(MYSQL_CONFIG, DB_NAME)
|
|
|
- url_pd = get_not_cralwer_url(keyword)
|
|
|
-
|
|
|
|
|
|
keyword = '麻辣火鍋'
|
|
|
if len(sys.argv) >1:
|
|
@@ -466,6 +466,7 @@ def main():
|
|
|
if len(sys.argv) >2:
|
|
|
port=int(sys.argv[2])
|
|
|
|
|
|
+ url_pd = get_not_cralwer_url(keyword)
|
|
|
print('drvier start...')
|
|
|
driver = brower_start(port)
|
|
|
# driver = serive_create('Profile 1')
|