Skip to content

Instantly share code, notes, and snippets.

@sproctor
Created March 31, 2018 14:31
Show Gist options
  • Save sproctor/faa7aab7d6300d36f9b3707a974ff658 to your computer and use it in GitHub Desktop.
Save sproctor/faa7aab7d6300d36f9b3707a974ff658 to your computer and use it in GitHub Desktop.
generate prices script
#!/bin/sh
if [ ! -f prices/template.html ]; then
cp prices/index.html prices/template.html
fi
./catty-scrape.py > output.temp
sed '/%content%/{
s/%content%//g
r output.temp
}' < prices/template.html > prices/index.html
Output:
(catty-scrape)[charles-cotesworth]$ ./generate-prices.sh
Traceback (most recent call last):
File "./catty-scrape.py", line 34, in <module>
print(material_price.get_text())
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 6: ordinal not in range(128)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment