[問題]BeautifulSoup在print時一片空白
我想要爬Facebook好友名稱
使用beautifulsoup沒有出現錯誤訊息但好友名稱也沒出來
具體程式碼在下面
from selenium import webdriver
import time,re
from bs4 import BeautifulSoup
driver=webdriver.Firefox()
driver.get("https://www.facebook.com")
username=driver.find_element_by_id("email")
username.send_keys("我的")
passwd=driver.find_element_by_id("pass")
passwd.send_keys("我的")
button=driver.find_element_by_id("loginbutton")
button. click()
我自己點到好友名單那
然後在執行下面
soup=BeautifulSoup(driver.page_source,"html5lib")
for block in soup.select('._60ri fsl fwb fcb a'):
print (block.text)
我是在jupyter上面執行,執行後沒出現錯誤訊息,但是也沒抓下任何資料
這是我要爬取目標
https://imgur.com/a/YVmrS7G
各位大大可以告訴我解決方法嗎謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.231.102.56
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1525001450.A.B45.html
→
04/29 19:33,
7年前
, 1F
04/29 19:33, 1F
→
04/29 20:35,
7年前
, 2F
04/29 20:35, 2F
→
04/29 20:35,
7年前
, 3F
04/29 20:35, 3F
→
04/29 20:52,
7年前
, 4F
04/29 20:52, 4F
→
04/29 20:53,
7年前
, 5F
04/29 20:53, 5F
→
04/29 20:55,
7年前
, 6F
04/29 20:55, 6F
→
04/29 21:13,
7年前
, 7F
04/29 21:13, 7F
→
04/29 22:47,
7年前
, 8F
04/29 22:47, 8F
→
04/29 23:07,
7年前
, 9F
04/29 23:07, 9F
Python 近期熱門文章
PTT數位生活區 即時熱門文章