简体   繁体   中英

How we can get data from Website using Webbot

Trying Web.find_elements but it is throwing an error

AttributeError: 'Browser' object has no attribute 'find_elements'

Code

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')

Thanks in advance...

The issue you're seeing is due to using an old version of webbot; upgrade to the latest version ( 0.1.4 ).

find_elements was added in Dec 2018 but your version ( 0.0.9 ) is from Jul 2018

Got the value using text in place of get_attribute('outerHTML') web.find_elements(id="afn-selling-fees")[0].text

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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