commit 8d0a889a0fd9a920318411dcc096fa9ee4087de8 Author: Benjamin Loison Date: Mon Apr 1 00:58:05 2024 +0200 Add `main.py` diff --git a/main.py b/main.py new file mode 100644 index 0000000..e93c868 --- /dev/null +++ b/main.py @@ -0,0 +1,15 @@ +import requests +from lxml import html + +url = 'https://www.linguee.fr/francais-anglais/search' +params = { + 'qe': 'a', + 'ch': 0 +} +text = requests.get(url, params = params).text +#print(text) +tree = html.fromstring(text) +items = tree.xpath('//div[@class="main_item"]') +#print(len(items)) +for item in items: + print(item.text_content()) \ No newline at end of file