我是新来的刮擦,我已经被阴囊保护挡住了。在
import bs4
from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
my_url = 'https://www.immoweb.be/fr/recherche/immeuble-de-rapport/a-vendre'
# opening up connection, grabbing the page
uClient = uReq(my_url)
page_html = uClient.read()
uClient.close()
#html parsing
page_soup = soup(page_html, "html.parser")
page_soup.h1
我无法访问网站上的任何数据,因为我被InCapsula问题阻止了。。。
当我键入:
我得到这样的信息:
<html style="height:100%"><head><meta content="NOINDEX, NOFOLLOW" name="ROBOTS"/><meta content="telephone=no" name="format-detection"/>
[...]
Request unsuccessful. Incapsula incident ID: 936002200207012991-
我做了一些这里描述的测试Getting ‘wrong’ page source when calling url from python,只有{a2}的解决方案可行。在
参见以下示例:
输出:
^{pr2}$相关问题 更多 >
编程相关推荐