Add main.py
				
					
				
			This commit is contained in:
		
							
								
								
									
										15
									
								
								main.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								main.py
									
									
									
									
									
										Normal file
									
								
							| @@ -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()) | ||||
		Reference in New Issue
	
	Block a user