FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Python/Google_News.py at master · u4trrtct/Python · GitHub
u4trrtct
/
Python
Public
forked from
geekcomputers/Python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Python
/
Google_News.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (21 loc) · 650 Bytes
Breadcrumbs
Python
/
Google_News.py
Copy path
File metadata and controls
31 lines (21 loc) · 650 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
bs4
from
bs4
import
BeautifulSoup
as
soup
from
urllib
.
request
import
urlopen
def
news
():
#my_url="https://news.google.com/news/rss"
my_url
=
"https://news.google.com/news/rss?ned=in&hl=en-IN"
#To open the Given URL
Client
=
urlopen
(
my_url
)
s_url
=
"https://news.google.com/news/headlines/section/topic/SPORTS.en_in/Sports?ned=in&hl=en-IN&gl=IN"
Client
=
urlopen
(
s_url
)
xml_page
=
Client
.
read
()
Client
.
close
()
soup_page
=
soup
(
xml_page
,
"xml"
)
news_list
=
soup_page
.
findAll
(
"item"
)
for
news
in
news_list
:
print
(
news
.
title
.
text
)
print
(
news
.
link
.
text
)
print
(
news
.
pubDate
.
text
)
print
(
"-"
*
150
)
n
=
input
()
news
()
Back
|
FazBrowse Home
|
New Git URL