|
@@ -46,7 +46,7 @@ def brower_start(port):
|
|
|
# browser = webdriver.Chrome(options=options)
|
|
|
options.add_argument('--ignore-certificate-errors')
|
|
|
options.add_argument("--no-sandbox")
|
|
|
- options.add_argument("--headless")
|
|
|
+# options.add_argument("--headless")
|
|
|
options.add_argument("--disable-gpu")
|
|
|
options.add_argument("--disable-dev-shm-usage")
|
|
|
browser = webdriver.Chrome(options=options)
|
|
@@ -531,7 +531,9 @@ def get_unique_id(driver):
|
|
|
|
|
|
def page_down_(driver, xpath_css, time_):
|
|
|
elmts = driver.find_elements_by_xpath(xpath_css)
|
|
|
+# print(xpath_css)
|
|
|
print(elmts)
|
|
|
+# time.sleep(9999)
|
|
|
if len(elmts)>1:
|
|
|
elmt=elmts[1]
|
|
|
else:
|
|
@@ -563,6 +565,8 @@ def main():
|
|
|
print('restart docker p{}'.format(port))
|
|
|
os.system('sudo docker container restart p'+str(port))
|
|
|
time.sleep(8)
|
|
|
+ else:
|
|
|
+ port = 2
|
|
|
|
|
|
for i in range(10):
|
|
|
result = db2.query('select * from swire_store_list where check_ is null ORDER BY RAND() limit 500')
|
|
@@ -574,6 +578,7 @@ def main():
|
|
|
# url_pd = get_not_cralwer_url(keyword)
|
|
|
# print('drvier start {}...'.format(keyword))
|
|
|
driver = brower_start(port)
|
|
|
+ time.sleep(4)
|
|
|
#driver = serive_create('Profile 6')
|
|
|
#profilepath = 'Profile 1'
|
|
|
#driver = serive_create_linux(profilepath)
|
|
@@ -586,7 +591,9 @@ def main():
|
|
|
|
|
|
print('start...')
|
|
|
driver.get(item_url)
|
|
|
- page_down_(driver, "//div[@class='x3AX1-LfntMc-header-title-ij8cu']", 3)
|
|
|
+# page_down_(driver, "//div[@class='x3AX1-LfntMc-header-title-ij8cu']", 3)
|
|
|
+ page_down_(driver, "//div[@class='x3AX1-LfntMc-header-title-ij8cu-haAclf']", 3)
|
|
|
+
|
|
|
# lat, lon = find_lon_lat(driver)
|
|
|
# unique_id = get_unique_id(driver)
|
|
|
time_status = time_click(driver)
|