[問題] aspx爬蟲翻頁問題

看板Python作者 (吉米兒)時間6年前 (2018/12/13 11:00), 編輯推噓2(208)
留言10則, 4人參與, 6年前最新討論串1/1
https://www.mittw.org.tw/products/manufacturer.aspx 想要將這個網頁的公司名稱爬蟲下來,但發現有翻頁問題 已經在stackoverflow等等網站找尋資訊,還是無法解決, 想請問各位py神有沒有方法可以解決這個問題。 以下是程式碼 from bs4 import BeautifulSoup import requests url = 'https://www.mittw.org.tw/products/manufacturer.aspx' url_get = requests.get(url) soup = BeautifulSoup(url_get.content, 'lxml') col = soup.find_all('div',{'class': "name"}) for ix in col: print(ix.get_text()) -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.117.248.4 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1544670049.A.FB6.html

12/13 11:17, 6年前 , 1F
Selenium
12/13 11:17, 1F

12/13 12:18, 6年前 , 2F
12/13 12:18, 2F

12/13 12:18, 6年前 , 3F
ASP都比較麻煩一點
12/13 12:18, 3F

12/13 13:13, 6年前 , 4F
謝謝cody880528你的code可以順利爬下來但是我有的看不
12/13 13:13, 4F

12/13 13:13, 6年前 , 5F
懂其中的含意可以幫我解釋一下嗎? 另一個問題就是假如
12/13 13:13, 5F

12/13 13:13, 6年前 , 6F
說main()爬取下來後怎麼將他也順利寫入csv擋
12/13 13:13, 6F

12/13 15:30, 6年前 , 7F
開開發者工具看網頁做了什麼就知道了
12/13 15:30, 7F

12/13 16:53, 6年前 , 8F
aspx背後程式碼有點看不懂cody打在def裡面有幾個網頁
12/13 16:53, 8F

12/13 16:53, 6年前 , 9F
原始檔的code不知道為什麼是這樣打我比較想知道原因為
12/13 16:53, 9F

12/13 16:53, 6年前 , 10F
什麼是挑選那幾個下去原始碼後就可以翻頁爬蟲
12/13 16:53, 10F
文章代碼(AID): #1S4SjX-s (Python)
文章代碼(AID): #1S4SjX-s (Python)