chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.main.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6306b14
)
Do entity conversion ourselves; lenny's BS won't for some reason
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 1 Sep 2009 14:39:54 +0000
(15:39 +0100)
committer
Ian Jackson
<Ian.Jackson@eu.citrix.com>
Tue, 1 Sep 2009 14:39:54 +0000
(15:39 +0100)
yarrg/yppedia-ocean-scraper
patch
|
blob
|
history
diff --git
a/yarrg/yppedia-ocean-scraper
b/yarrg/yppedia-ocean-scraper
index 5f9c5f007b46fda4265ccc7492dc2b3d58e079f0..30d0c4a8de8d895292879a074a6bf654ecdec4c5 100755
(executable)
--- a/
yarrg/yppedia-ocean-scraper
+++ b/
yarrg/yppedia-ocean-scraper
@@
-62,8
+62,7
@@
def fetch():
debug('fetching',url)
dataf = urllib2.urlopen(url)
debug('fetched',dataf)
debug('fetching',url)
dataf = urllib2.urlopen(url)
debug('fetched',dataf)
- soup = BeautifulSoup(dataf,
- convertEntities=BeautifulSoup.HTML_ENTITIES)
+ soup = BeautifulSoup(dataf)
title_arch_re = regexp.compile('(\\S.*\\S) Archipelago \\((\\S+)\\)$')
title_arch_re = regexp.compile('(\\S.*\\S) Archipelago \\((\\S+)\\)$')
@@
-86,9
+85,13
@@
def title_arch_ok(t):
def parse_chart():
ta = soup.find('textarea')
debug('ta',ta)
def parse_chart():
ta = soup.find('textarea')
debug('ta',ta)
- rc = ta.renderContents()
- debug('rc',rc)
- return rc
+ s = ta.string
+ debug('s',s)
+ s = regexp.sub(r'\<\;', '<', s)
+ s = regexp.sub(r'\>\;', '>', s)
+ s = regexp.sub(r'\&\;', '&', s)
+ debug('s',s)
+ return s
def parse_ocean():
firstarch = soup.find('a', attrs = {'title': title_arch_ok})
def parse_ocean():
firstarch = soup.find('a', attrs = {'title': title_arch_ok})