<p>他们认为你是一个机器人,不允许你提取内容</p>
<p>这里的关键一课-当你没有得到你期望的,检查你得到了什么。在</p>
<p>为了得到下面的文字,我只是把内容打印出来。在</p>
<pre><code>>>>import requests
>>>page = requests.get('http://www.bizjournals.com/milwaukee/datacenter/project-watch-what-is-being-built-in-milwaukee.html')
page_content = requests.content
>>>len(page_content) # here I am just trying to make sure I am not going to cause IDLE to freeze if page_content is unreasonably large
4319 # so the string that is the content is 4319 characters I am going to print 200 characters (the rest is below)
>>>print page_content[0:200]
<!DOCTYPE html>
<html>
<head>
<title>Pardon Our Interruption</title>
<link rel="stylesheet" type="text/css" href="//cdn.distilnetworks.com/css/distil.css" media="all">
</code></pre>
<p>在
</p><p>我一直在检查数据源,试图弄清楚地图上的值是从哪里来的。我认为数据是JSON,但似乎仍然无法识别这些数据是如何被调用和传递到浏览器的。我想你需要定义一些头来发送你的请求。在</p>
<p>我试过几次,但还没有成功。在</p>
<p>看这个问题<a href="https://stackoverflow.com/questions/27652543/how-to-use-python-requests-to-fake-a-browser-visit">How to use Python requests to fake a browser visit?</a></p>
<p><strong>不过,我确实读过他们的使用规则,而且他们禁止刮取他们的内容。请参阅此链接<a href="http://acbj.com/privacy#V2" rel="nofollow noreferrer">http://acbj.com/privacy#V2</a>。</strong></p>
<p><strong>复制、获取、抓取、索引、刮取、蜘蛛、挖掘、收集、提取、编译、获取、聚合、捕获或存储任何内容,包括但不限于照片、图像、文本、音乐、音频、视频、播客、数据、软件、源代码或目标代码、算法、统计数据、分析、公式、索引、注册表、存储库,或服务上或通过服务获得的任何其他信息,包括通过自动或手动流程或其他方式获得的信息,前提是我们已采取措施禁止、禁止或阻止您这样做;</strong></p>
<p>我想我正在寻找一种获取数据的方法,但在阅读了上面的链接后就停止了。在</p>
<p>'\n\n\n\n\n\n\n\n\n请原谅我们的打扰\n\n\n\n\n\n\n\n\n\n\n\n\n\n <img src="//cdn.distilnetworks.com/images/anomaly-detected.png" alt="0"/>\n\n\n</p><h2>请原谅我们的打扰…</h2>\n<p>\n当您浏览<strong><a href="http://www.bizjournals.com" rel="nofollow noreferrer">http://www.bizjournals.com</a></strong>时,您的浏览器的某些问题使我们认为您是一个机器人。有几个原因可能会发生:\n</p>\n<ul>\n<li>你是一个超级用户,以超人的速度浏览这个网站。</li>\n<li>您已经在web浏览器中禁用了JavaScript。</li>\n<li>第三方浏览器插件(如Ghostery或NoScript)正在阻止JavaScript的运行。更多信息请参见http://ds.tl/help-third-party-plugins\'target=\'''u blank\'>;支持文章。</li>\n</ul>\n<p>\n若要请求解除阻止,请填写下表,我们将尽快审阅。\n</p>\n\n Ignore:忽略:忽略:忽略:\n\n名字\n