0
나는 파이썬에서 API 결과의 내용을 얻으려고하고있다.
이미지가있는 HTML 템플릿입니다.API의 내용 HTML 얻기
콘텐츠를 얻기 위해 많은 방법을 시도했지만 매번 작동하지 않습니다.
fuction를 :
Iprint html
이 이해할 수없는 문자의 많은이
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']
.
누군가이 문제를 호소하도록 도와 줄 수 있습니까?
정말 고마워요.
api는 HTML이 아닌 원시 이미지 파일 (기본값은 png)을 반환합니다. – Cyrbil