使用urllib包擷取百度首頁資訊:
使用Requests庫擷取百度首頁資訊:
1.導入requests
2.使用requests.get擷取網頁源碼
1.導入bs4
2.解析網頁資料
3.尋找資料
4.for循環列印
1.導入pandas
2.建立list對象
3.使用to_csv寫入
ok.這樣就完成了一個簡單的爬蟲!
使用urllib包擷取百度首頁資訊:
使用Requests庫擷取百度首頁資訊:
1.導入requests
2.使用requests.get擷取網頁源碼
1.導入bs4
2.解析網頁資料
3.尋找資料
4.for循環列印
1.導入pandas
2.建立list對象
3.使用to_csv寫入
ok.這樣就完成了一個簡單的爬蟲!