我正在尝试编写一个程序,在this webpage上为IUPACcondensed创建一个片段。你知道吗
这里G03307GF
是ID。我需要这个:
HexNAc(b1-?)[Fuc(a1-?)]GlcNAc(b1-2)Man(a1-3)[HexNAc(b1-?)[Fuc(a1-?)]GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)[Fuc(a1-6)]GlcNAc
我试着用硒来做这个。你知道吗
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument('--headless')
driver = webdriver.Chrome('', options = chrome_options)
# takes accession number and returns IUPAC
def getIUPAC(acc_no):
url = 'https://glytoucan.org/Structures/Glycans/' + acc_no
driver.get(url)
IUPAC = driver.find_element_by_xpath('//*[@id="descriptors"]/togostanza-iupaccondensed//main/div/pre/code/text()')
driver.close()
return IUPAC
IUPAC = getIUPAC('G37498VS')
print(IUPAC)
It says the the element does not exist.
更好地使用毒液所显示的请求。只是想补充一下,你得到的是
element does not exist
,因为驱动程序在你打印之前已经关闭了。你知道吗我们的结果是。。。你知道吗
相关问题 更多 >
编程相关推荐