如何使用 python 网络抓取在此 html 中获取公司名称?

how to get company name in this html using python web scraping?

我正在抓取 yellowpages.com.au 上的公司名称,我知道如何找到正确的元素 (div class) 来找到所有名称。 下面是我的 python 代码和 url 我想抓取公司名称信息的地方。 每次,我 运行 这个代码,我什么也得不到。

``` import bs4
from bs4 import BeautifulSoup
import lxml
import requests

url='https://www.yellowpages.com.au/search/listings?clue=plywood&locationClue=Northern+Territory&lat=&lon='

response=requests.get(url)
print('ok')

soup=BeautifulSoup(response.text,'lxml')
page=soup.find_all('div', class_="body left")
print(page) ```

我附上了检查过的照片website/url。

希望你能帮我找到正确的元素或重写我的代码。

或许可以考虑以下免费 APIs

http://developers.sensis.com.au/docs/endpoint_reference

来自:

http://developers.sensis.com.au/

参见服务条款:

http://developers.sensis.com.au/Terms_of_Service

他们维护着大量黄色和白色的 AU 企业列表。 API 个端点包括 search.

http://developers.sensis.com.au/docs/endpoint_reference/Search

规格摘要:

https://www.programmableweb.com/api/sensis-business-search-rest-api

从文档来看似乎相当简单。您需要注册一个 API 密钥。