-
Notifications
You must be signed in to change notification settings - Fork 1
/
cambrizFinal.py
26 lines (24 loc) · 935 Bytes
/
cambrizFinal.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from selenium import webdriver
from bs4 import BeautifulSoup
import pandas as pd
driver = webdriver.Chrome("chromedriver")
driver.get("https://dictionary.cambridge.org/dictionary/english/horrible")
#driver.get("https://www.learndifferences.org")
#driver.get("https://www.flipkart.com/laptops/~buyback-guarantee-on-laptops-/pr?sid=6bo%2Cb5g&uniq")
content = driver.page_source
#htmltxt = "<p>Hello World</p>"
soup = BeautifulSoup(content,"lxml")
#for row in soup.find_all('div',attrs={"class" : "vg"}):
# print (row.text)
#kk=soup.find_all('span',attrs={"class" : "dtText"})
for row in soup.find_all('div',attrs={"class" : "def ddef_d db"}):
print("...................................................................")
string=row.text
print(string.strip(' :'))
#print(soup.prettify())
#abasasas=soup.text
#aaa=soup.find_all('a')
#l=len(aaa)
#print(aaa[0].get_text())
#print(aaa[1].get_text())
#print(aaa[2].get_text())