fix wolframalpha scraping
This commit is contained in:
parent
31c0689628
commit
f6207959ee
|
@ -26,9 +26,8 @@ def wolframalpha(inp):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
for image in pod.xpath('div/div[@class="output"]/img'):
|
for alt in pod.xpath('div/div[@class="output pnt"]/img/@alt'):
|
||||||
alt = image.attrib['alt'].strip()
|
alt = alt.strip().replace('\\n', '; ')
|
||||||
alt = alt.replace('\\n', '; ')
|
|
||||||
alt = re.sub(r'\s+', ' ', alt)
|
alt = re.sub(r'\s+', ' ', alt)
|
||||||
if alt:
|
if alt:
|
||||||
results.append(alt)
|
results.append(alt)
|
||||||
|
|
Loading…
Reference in New Issue