Pythonを使ってWebスクレイピングをしようとしています。私は(私の目標)である製品のリンクを取得しようとしています
http://www.fastfurnishings.com/3-Piece-Reversible-Bonded-Leather-Match-Sofa-Set-i-p/bstrblm3p.htm
この URL / サイトをスクレイピングしています
http://www.fastfurnishings.com/SearchResults.asp?Search=3-Piece+Reversible+Bonded+Leather+Match+Sofa+Set+in+Cream
ページ ビューを実行すると、必要な URL を特定するのに役立つ特定の ID やタグがないことがわかります。また、正規表現も苦手です。私はこれまでPythonでこれを持っています
import urllib
import re
product = "3-Piece Reversible Bonded Leather Match Sofa Set in Cream"
productSearchUrl = product.replace(" ","+");
myurl = "http://www.fastfurnishings.com/SearchResults.asp?Search="+productSearchUrl
print myurl
htmlfile = urllib.urlopen(myurl)
htmltext = htmlfile.read()
regex = '<td valign="top" width="33%" align="center">(.+?)</td> '
r = re.compile(regex)
print re.findall(r,htmltext)
しかし、それは何も読んでいません...助けていただければ幸いです