爬取药监网站公司名录
##我的网盘/博客素材/爬取药监
#爬取药监总局化妆品生产许可企业名称
from selenium import webdriver
from time import sleep
from lxml import etree
url = 'http://scxk.nmpa.gov.cn:81/xk/'
bro = webdriver.Chrome(executable_path='./chromedriver')
bro.get(url)
page_text_list = [] #每一页页面源码数据
sleep(1)
#捕获当前页面源码数据
page_text = bro.page_source
page_text_list.append(page_text)
#点击下一页
for i in range(3):
    next_page = bro.find_element_by_xpath('//*[@id="pageIto_next"]')
    next_page.click()
    sleep(1)
    page_text_list.append(bro.page_source) #获取每一页页面源码数据
for page_text in page_text_list:   #对每一页页面源码数据进行解析
    tree = etree.HTML(page_text)
    li_list = tree.xpath('//*[@id="gzlist"]/li')
    for li in li_list:
        name = li.xpath('./dl/@title')[0]
        time = li.xpath('./em/@title')[0]
        print(name)
        print(time)
sleep(1)
bro.quit()
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇