擅长:python、mysql、java
<p>一旦你能够访问网站,你就可以找到这样的例句</p>
<pre><code>req = requests.get("https://context.reverso.net/translation/english-russian/cat", headers={'User-Agent': 'Mozilla/5.0'})
soup = BeautifulSoup(req.text, 'lxml')
sentences = [x.text.strip() for x in soup.find_all('span', {'class':'text'}) if '\n' in x.text]
>>> sentences[:4]
['My cat stepped on the remote.', 'Я не смотрю твои бредни, мой кот наступил на пульт.', 'Now imagine you have a cat...', 'А теперь представьте, что у вас есть кот...']
</code></pre>