Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 59669

Beautiful Soup is a Python library for pulling data out of HTML and XML files.

2 votes
1 answer
7k views

Check existence of HTML tags in a row

Using Python's Beautiful Soup, I analyze a number of html files (internally: soup). They are all a little different and my target comes in four different tags - or not at all. In two cases, my target …
MERose's user avatar
  • 405
0 votes

Remove (not extract) timestamp from HTML string

Based on MathiasEttinger's suggestions in the comments and my initial feeling, I tried using dateutils: from bs4 import BeautifulSoup from dateutil import parser date1 = '<P><SPAN STYLE="font-family: … CONLEY, Northwestern University</SPAN></P>""" soup3 = BeautifulSoup(date3) print repr(soup3.text) # u' 4:00 PM\tJOHN P. …
MERose's user avatar
  • 405
1 vote
2 answers
1k views

Remove (not extract) timestamp from HTML string

from bs4 import BeautifulSoup date1 = '<P><SPAN STYLE="font-family: Univers" STYLE="font-size: 11pt"><STRONG></STRONG></SPAN><SPAN STYLE="font-family: Univers" STYLE="font-size: 11pt">10:15 AM ARVIND … (date1) print repr(soup1.text.strip()) # "u'10:15 AM ARVIND KRISHNAMURTHY, Northwestern University'" soup2 = BeautifulSoup(date2) print repr(soup2.text.strip()) # "u'8:45 a.m.RICARDO CABALLERO, MIT and …
MERose's user avatar
  • 405