from bs4 import BeautifulSoup
import requests
response = requests.get("https://www.facebook.com/pg/officialstackoverflow/about/?ref=page_internal")
html = response.content
soup = BeautifulSoup(html, "html")
mission_statement = soup.find('div', attrs={'class': '_3-8w'})
print(mission_statement.text)
> To make the internet a better place and be the best site to find expert answers to your programming questions.
Facebook图形API用于"apps to read and write to the Facebook social graph",因此在本例中不能使用它。相反,应该使用Python抓取库,比如beautifulsoup。在
在Facebook上为组织的使命声明创建About页面的例子如下:
相关问题 更多 >
编程相关推荐