我使用python脚本从网站(http://www.opensiteexplorer.org/)获取特定文本。例如,尝试此搜索:http://www.opensiteexplorer.org/links?site=www.google.com
我想得到“页面权限”和“根域”并过滤掉。在
我使用这个代码:
response = br.open( 'http://www.opensiteexplorer.org/links?site=' + blog)
tree = html.fromstring(response.read())
authority = int (tree.xpath('//span[@class="metrics-authority"]/text()')[1].strip())
if authority>1:
print blog
print 'This blog is ready to be registered'
print authority
f.write(blog +' '+ str(authority) +'\n')
在这里我过滤大于1的PA,我还想过滤链接大于5的根域。我怎么能做到呢?在
您可以使用}:
metrics-authority
类获得所有2个跨距,第一个是Domain Authority
,第二个是Page Authority
。另外,您可以使用id="metrics-page-link-metrics"
从div
获得{印刷品:
^{pr2}$希望有帮助。在
相关问题 更多 >
编程相关推荐