【发布时间】:2020-11-19 05:06:45
【问题描述】:
从这个url,我正在尝试提取链接https://www.collinsdictionary.com/dictionary/french-english/conjugation/aimer in
<a class="link-right verbtable" href="https://www.collinsdictionary.com/dictionary/french-english/conjugation/aimer">Full verb table</a>
其 CSS 选择器为 div.content.definitions.dictionary.biling > div.hom > span > span.xr > a。我按照 Automate the Boring Stuff with Python 一书中的说明操作
from bs4 import BeautifulSoup
url = 'https://www.collinsdictionary.com/dictionary/french-english/aimer'
soup = BeautifulSoup(url, 'html.parser')
soup.select('div.content.definitions.dictionary.biling > div.hom > span > span.xr > a')
能否请您详细说明[]的结果如何?
【问题讨论】:
标签: python-3.x beautifulsoup css-selectors