繁体   English   中英

我们如何使用 Webbot 从网站获取数据

[英]How we can get data from Website using Webbot

尝试 Web.find_elements 但它抛出一个错误

AttributeError:“浏览器”object 没有属性“find_elements”

代码

from webbot import Browser
from bs4 import BeautifulSoup
web = Browser()
web.go_to('http://some_link')
web.click(id='link_continue')
print("Login Successful")
web.type('some_value' , into = 'Enter your product name, UPC, EAN, ISBN or ASIN')
web.click(id='a-autoid-0')
web.type('799',tag='input',id='afn-pricing')
web.type('923',tag='input',id='afn-cost-of-goods')
web.click(id='update-fees-link')
web.find_elements(id="afn-selling-fees")[0].get_attribute('outerHTML')

提前致谢...

您看到的问题是由于使用了旧版本的 webbot; 升级到最新版本( 0.1.4 )。

find_elements2018 年 12 月添加,但您的版本( 0.0.9 )来自2018 年 7 月

使用文本代替 get_attribute('outerHTML') web.find_elements(id="afn-selling-fees")[0].text

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM