Skip to content

Commit d7e911b

Browse files
author
Dineshkarthik
committed
updated 8 and 9
1 parent 4aefa2c commit d7e911b

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

Dineshkarthik/0008/0008.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/local/bin/python
2+
#coding=utf-8
3+
__author__ = 'Dineshkarthik'
4+
5+
#0008 Title: an HTML file, find the inside of the body .
6+
7+
8+
import urllib2
9+
from bs4 import BeautifulSoup
10+
11+
url = "https://www.google.co.in"
12+
page = urllib2.urlopen(url)
13+
14+
soup = BeautifulSoup(page)
15+
print soup.body.text

Dineshkarthik/0009/0009.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/local/bin/python
2+
#coding=utf-8
3+
__author__ = 'Dineshkarthik'
4+
5+
#0008 Title: an HTML file, find the inside of the link .
6+
7+
8+
import urllib2
9+
from bs4 import BeautifulSoup
10+
11+
url = "https://www.google.com"
12+
page = urllib2.urlopen(url)
13+
14+
soup = BeautifulSoup(page)
15+
links = soup.findAll('a')
16+
for link in links:
17+
print(link['href'])

0 commit comments

Comments
 (0)