-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearchAllTag.py
More file actions
35 lines (25 loc) · 819 Bytes
/
SearchAllTag.py
File metadata and controls
35 lines (25 loc) · 819 Bytes
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
27
28
29
30
31
32
33
34
35
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
import time
#driver = webdriver.Chrome()
#driver.get("http://example.webscraping.com/places/default/index/")
#html_doc = driver.page_source
url = "http://example.webscraping.com/places/default/index/"
html_doc = requests.get(url)
soup = BeautifulSoup(html_doc.text,'lxml')
##all_tag = soup.find_all('a')
##print(all_tag)
##print("Number of all ankr tag : " + len(all_tag))
#findClass = soup.find(class_ = "span12")
#print(findClass)
##allClass = soup.find_all(class_ = "row")
##print(allClass)
##print(len(allClass))
#more_spacfic = soup.find_all('a',{'id :results'})
#print(more_spacfic);
#print(len(more_spacfic))
matchinString = soup.find_all('a', string = 'Log In')
print(matchinString)
print(len(matchinString))
#driver.quit()