簡體   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