import sys
import csv
import urllib2
import BeautifulSoup
#page = urllib2.urlopen(sys.argv[1]).read()
soup = BeautifulSoup.BeautifulSoup(open(sys.argv[1]).read())
csvout = csv.writer(sys.stdout)
for table in soup.findAll('table'):
print "
#print '#'
#print '# Table'
#print '# Fields: ' + ','.join([tr.text for tr in table.findAll('th')])
for row in table.findAll('tr'):
print "
"#csvout.writerow([tr.text for tr in row.findAll('td')])
for tr in row.findAll('td'):
print "
"print tr.text.encode("utf-8")
print "
"print "
"print "
"break
#!/bin/bash
#process.h
basedir=$(dirname $1)
echo $basedir
#echo \
\\ >> $basedir/baobei.htmlprodname=$(grep -o '
.*' $1 | cut -d \> -f 2 | cut -d \< -f 1)prodname=$(echo $prodname | cut -d _ -f 1)
price=$(grep -o '[0-9]*' $1 | cut -d \> -f 2 | cut -d \< -f 1)
echo \
echo \
>> $basedir/baobei.htmlecho \
Name\ >> $basedir/baobei.htmlecho \
$prodname\ >> $basedir/baobei.htmlecho \
>> $basedir/baobei.htmlecho \
>> $basedir/baobei.htmlecho \
Price\ >> $basedir/baobei.htmlecho \
$price\ >> $basedir/baobei.htmlecho \
>> $basedir/baobei.htmlpython ./printtab.py $1 >> $basedir/baobei.html
echo \
>>