我是新手,我已经被 Incapsula 保护阻止了。
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 问题阻止了......
当我输入:
print(page_soup)
我收到这条消息:
<html style="height:100%"><head><meta content="NOINDEX, NOFOLLOW" name="ROBOTS"/><meta content="telephone=no" name="format-detection"/>
[...]
Request unsuccessful. Incapsula incident ID: 936002200207012991-