Skip to content

Commit

Permalink
Update scrapebotv3.py
Browse files Browse the repository at this point in the history
strip puntuation marks from case name, to fix the s\o errors with the slash
  • Loading branch information
backup000 committed Mar 1, 2016
1 parent b86a2a2 commit 2960f83
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scrapebotv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ def returnListofDocumentURLsonResultspage(bsObj):
s = session.get(documenturl, headers=headers)
bsObj = BeautifulSoup(s.content, 'html.parser')
nameofcase = bsObj.find('span', class_ = "caseTitle").get_text()

import string
for char in string.punctuation: #strip puntuation marks from case name
nameofcase = nameofcase.replace(char, " ")

if bsObj.find('span', class_ = 'Citation offhyperlink'):
citation = bsObj.find('span', class_ = 'Citation offhyperlink').get_text()
combinednameofcase = (nameofcase + citation)
Expand Down

0 comments on commit 2960f83

Please sign in to comment.