擅长:python、mysql、java
<p>当前代码获取所有链接,但它只存储一个<code>BeautifulSoup</code>对象引用。您可以将它们全部存储在数组中,或者在访问另一个URL之前处理它们(如下所示)。在</p>
<pre><code>for n in FullPage:
URL = urlp1 + n
page = urllib2.urlopen(URL)
bsObj = BeautifulSoup(page, "html.parser")
descList = bsObj.findAll('div', attrs={"class": "panel-default"})
for desc in descList:
print(desc.getText(separator=u' '))
</code></pre>
<p>另外,请注意,使用pascalase的名称按惯例是为类保留的。<code>FullPage</code>通常写为<code>fullPage</code>或{<cd4>},如果它是常量的话。在</p>