WOS论文详细数据页面信息selenium爬虫

本文介绍了一个使用 Python 的 Selenium 库从 Web of Science 平台自动爬取学术论文详细信息的示例程序。该程序能够获取每篇论文的标题、作者、来源期刊、DOI、关键词等关键元数据,并将其保存为 CSV 文件。
该文章已生成可运行项目,
import random

from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
import csv
import time
import re

def start_spider():
    browser.get(url)
    page = browser.page_source
    time.sleep(2)
    title=browser.find_element_by_class_name("title").text
    print(title)#标题
    list.append(title)

    author_list=[]
    authors=browser.find_elements_by_xpath('.//a[@title="查找此作者的更多记录"]')
    authors_num=browser.find_elements_by_tag_name("sup")
    # for author in authors:
    #     author_list.append(author.text)
    for author in range(0,len(authors)):
        try:
            author_list.append(authors[author].text + authors_num[author].text)
        # pattern3 = re.compile('alt="Find more records by this author">(.*?)</a>')
        # author = re.findall(pattern3, html)
        except:
            continue
    list.append(author_list)


    # ###作者详细信息
    # author_detail=browser.find_element_by_xpath("//*[@id='show_resc_blurb']/table")
    # tr_content=author_detail.find_elements_by_tag_name("tr")
    detailauthor_list = []
    # for tr in tr_content:
    #     try:
    #         tds=tr.find_elements_by_tag_name("td")
    #         for td in tds:
    #             detailauthor_list.append(td.get_attribute('textContent'))
    #             print(detailauthor_list)
    #             print(td.get_attribute('textContent'))
    #         # name=tr.find_element_by_tag_name("display_name").text
    #         # Web_of_Science_ResearcherID=tr.find_element_by_class_name("snowplow-RIDnumber").text
    #         # orcid=tr.find_element_by_class_name("snowplow-ORCIDnumber").text
    #         # detailauthor_list.append(name)
    #         # detailauth
本文章已经生成可运行项目
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

苏格拉没有鞋底

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值