0
私はAPIの結果の内容をpythonで取得しています。
これはイメージが内部にあるHTMLテンプレートです。APIのコンテンツHTMLを取得
コンテンツを取得するために多くの方法を試しましたが、毎回機能しません。
のfuction:
def screenshotlayer(self, access_key, secret_keyword, domain, args):
domain = "http://" + domain
url = "http://api.screenshotlayer.com/api/capture?access_key=API_KEY&url=http://google.com&viewport=1440x900&width=250"
html = urllib2.urlopen(url).read()
print html
soup = BeautifulSoup(html, 'html.parser')
return soup.findAll('img')[0]['src']
I print html
、不可解な文字がたくさんあります。
誰かがこの問題を解決できますか?
ありがとうございました。
apiはHTMLを返しませんが、rawイメージファイル(デフォルトはpng)を返します。 – Cyrbil