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

How we can get data from Website using Webbot

正在尝试 Web.find_elements 但出现错误

AttributeError: 'Browser' object has no attribute '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_elements 添加到 Dec 2018 但您的版本 (0.0.9) 来自 Jul 2018

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