python - 如何从该 URL 获取氨基酸序列?
问题描述
我想通过使用 python 和 Selenium 从下面的 url 获取氨基酸序列,但无法成功。http://flybase.org/download/sequence/FBgn0003719/FBpp
我试过你美丽的汤和硒。
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('http://flybase.org/download/sequence/FBgn0003719/FBpp')
iframe = driver.find_element_by_class_name('scroller')
notification_element = driver.find_element_by_class_name('fastaSeq')
print(notification_element)
消息:没有这样的元素:无法找到元素
解决方案
只需要使用网络选项卡中的专用 API requests
。
import requests
r = requests.get('http://flybase.org/api/sequence/id/FBgn0003719/FBpp').json()
print(r['resultset']['result'][0]['sequence'])
推荐阅读
- module - Prestashop 支付模块,处理来自外部服务器的 POST 请求
- javascript - jQuery 选择链接在 Chrome 上不起作用
- javascript - 在页面加载时运行 TamperMokey 脚本
- jsreport - Jsreport XLSX 接收方:将 jsreport 响应保存到 excel 文件
- jmeter - JMeter 将加载时间保存到变量中
- javascript - 如何将对象添加到数组 + Firestore?
- angular - Angular 6 BehaviorSubject“未定义”:错误:TypeError:无法读取我声明的 BehaviorSubject 的属性
- python - 使用一个 .map 调用来使用一个字典更改数据框中多个系列/列的值
- html - 如何制作响应式引导下拉按钮?
- css - iPhone 8 时 iPhone 的媒体查询为 iPhone 10 加载 css