中。
守则:
import bs4
import sys
from bs4 import BeautifulSoup
import requests
url = requests.get("https://www.ncbi.nlm.nih.gov/nuccore/{FASTA}?report=fasta".format(FASTA="NM_213035.1"))
url.raise_for_status()
ncbi = bs4.BeautifulSoup(url.text, "html.parser")
filename = ncbi.title.text
with open(filename, 'w+') as f:
for i in ncbi.select('p'):
f.write(i.getText())产出:
警告: NCBI网站需要JavaScript才能运行。更多...下载features.Download基因features.NCBI参考序列: NM_213035.1
GenBank图形学
全序列
选定区域
发自:
至:
显示反向补码
显示空白功能,您的浏览活动是empty.Activity录音是关闭的。打开录音
美国国家医学图书馆国家生物技术信息中心
8600罗克维尔派克,贝塞斯达医学博士,20894美国
发布于 2021-01-19 11:48:58
您没有使用正确的URL通过REST获取FASTA文件。正如@Ghoti所指出的,正确的URL在这里描述:https://www.ncbi.nlm.nih.gov/books/NBK25497/
对于你来说,具体的问题是:
https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=NM_213035.1&rettype=fasta&retmode=text如果您正在使用Python,您可以使用黑云母完成这项任务,这是我正在开发的一个包:https://www.biotite-python.org/apidoc/biotite.database.entrez.fetch.html。
https://stackoverflow.com/questions/65705108
复制相似问题