一、配置python环境
详见百度
二、Chromdriver安装
Chromdriver下载地址:
http://chromedriver.storage.googleapis.com/index.html
http://npm.taobao.org/mirrors/chromedriver/
需要下载与本机谷歌浏览器版本一致,具体配置百度。
三、安装软件Pycharm
官网下载即可。
四、爬虫
代码如下:
# 通过GSM号搜索ncbi中的Run,SRX细节页信息
# GSM号表中以GSM为列名,以GSM号为列内容
import requests #导入requests包
import pandas as pd
import re
from bs4 import BeautifulSoup
url = 'https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc='
# strhtml = requests.get(url) #Get方式获取网页数据
# print(strhtml.text)
df = pd.read_csv("C://Users//admin//Desktop//pachong//GSE195956//srr.csv", encoding='utf-8')
row = df['gsm']
# 列表字段
GSE = ""
GSMID = ""
GSMName = ""
PMID = ""
Characteristic = ""
Source_name = ""
Organism = ""
SRR = ""
Instrument = ""
Strategy = ""
Source = ""
Selection = ""
Layout = ""
for gsm in row:
gsmurl = url+gsm
print(gsmurl)
strhtml = requests.get(gsmurl)
sampleDetailSoup = BeautifulSoup(strhtml.text, 'lxml')
detailHtml = sampleDeta

最低0.47元/天 解锁文章
3933

被折叠的 条评论
为什么被折叠?



