Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mason-today-web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
mason-today-web
Commits
8be289c9
Commit
8be289c9
authored
Dec 21, 2017
by
Aaron R Poulter-martinez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edited parscript to list out all titles as text
parent
5679d9aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
pscripts/parscript.py
pscripts/parscript.py
+16
-8
No files found.
pscripts/parscript.py
View file @
8be289c9
...
...
@@ -28,17 +28,25 @@ xmldoc = requests.get("http://25livepub.collegenet.com/calendars/events_all.xml"
#xmldoc = open("events.xml", "r") #Opens a local document. events.xml is a shortened version of the larger events doc
xmldoc
=
cleanup
(
xmldoc
.
text
)
print
xmldoc
#
print xmldoc
soup
=
BeautifulSoup
(
xmldoc
,
"lxml"
)
#creates soup of the xml
print
soup
.
prettify
(),
"
\n\n
"
#
print soup.prettify(), "\n\n"
#creates a list of all the entry tags from the xml
entries
=
soup
.
findAll
(
'entry'
)
entries
=
soup
.
find_all
(
'entry'
)
#creates a list of all the entry tags from the xml
#print type(entries[0]), "\n" #prints the first entry
#print entries[0].prettify(), "\n" #prints the first entry out
#print entries[0].find('content').prettify(), "\n" #prints the first content tag in the first entry
#just to make sure things still work
#print entries[0].title.text
#for item in entries:
# print item.find('content').string, "\n\n"
#indexs an entry in the list of entries
for
entry
in
entries
:
#pulls up an entry in the list of entries, finds the title tag and text deletes all xml tags and returns just the text
title_text
=
entry
.
title
.
text
print
title_text
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment