例如,如果您訪問此處: https: //www.basspro.com/shop/en/herters-hunting-rifle-ammo/您會注意到,在第一次加載時,它會顯示庫存中的所有內容。然后,頁面將再次更新并顯示所有缺貨的商品。有什么方法可以使用 beautifulsoup 來解決這個問題嗎?我開始認為我需要使用不同的策略來提取更新的 HTML 代碼。就目前情況而言,我的代碼沒有返回任何內容,因為 beautifulsoup 提取的代碼中沒有“缺貨”文本。content_wrapper = soup.find('div', class_='col2 gridCell StoreAvail editable anchored', id='StoreAvail_7')cheese = content_wrapper.find('div', class_='sublist instore_inventory_section nodisplay', id='WC_InStore_Inventory_Section_3074457345618960372')print(cheese)
添加回答
舉報
0/150
提交
取消