Commit 8af9e609 by lichenggang

'update header'

parent 761832ca
Showing with 4 additions and 3 deletions
......@@ -21,7 +21,7 @@ partid_pattern = re.compile('partId=(.*)')
pid_driver_map = dict()
logger = Mylogger('error.log').logger
dcap = dict(DesiredCapabilities.PHANTOMJS)
dcap["phantomjs.page.settings.userAgent"] = ("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safari/537.36 SE 2.X MetaSr 1.0") #设置user-agent请求头
dcap["phantomjs.page.settings.userAgent"] = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36") #设置user-agent请求头
dcap["phantomjs.page.settings.loadImages"] = False
def gen_table_doms(url, cat_id):
pid = os.getpid()
......@@ -158,10 +158,11 @@ if __name__ == '__main__':
p = Pool(3)
for req in get_url():
# for req in [('https://www.chip1stop.com/HKG/zh/view/searchResult/SearchResultTop?classCd=081015&classLv=3&subWinSearchFlg=false&searchType=2&dispAllFlg=true&searchFlg=false&direct_Flg=true',0)]:
url = req[0]
cat_id = req[1]
# for url in ['https://www.chip1stop.com/CHN/zh/view/searchResult/SearchResultWithClassCd?classCd=010233&classLv=3&dispAllFlg=true&UseSession=false']:
p.apply_async(gen_table_doms, args=(url, cat_id))
# gen_table_doms(url)
# gen_table_doms(url,cat_id)
p.close()
p.join()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment