From 8d0a889a0fd9a920318411dcc096fa9ee4087de8 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Mon, 1 Apr 2024 00:58:05 +0200 Subject: [PATCH] Add `main.py` --- main.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 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