def get_taobao_cate():
url = 'https://shopsearch.taobao.com/search?app=shopsearch'
driver = webdriver.PhantomJS(executable_path="d:\\phantomjs.exe")
driver.get(url)
driver.implicitly_wait(3)
page = driver.page_source
soup = BeautifulSoup(page, 'lxml')
cate_name = re.findall(r"q=(.*?)&tracelog=shopsearchnoqcat", str(soup))
for c in cate_name:
cname = urllib.parse.unquote(c, encoding='gb2312')
cate_list.append(c)
print(cname)
print(cate_list)
评论列表
文章目录