2017-12-02 3 views
0

내가 가진은 iframe의 내용을 얻기 위해 노력하고 있어요 :은 iframe 내용을 얻을 수 없음 수

for thing in article_edit_soup.find("iframe", {"class":"cke_wysiwyg_frame cke_reset"}): 
    for things in thing.contents: 
     f.write(things.strip("\t")) 

을하고 오류 제공합니다

TypeError: 'NoneType' object is not iterable

을하지만 난 때 iframe을 볼 수 있습니다 확신 웹 페이지를 검사합니다.

+0

'article_edit_soup.find ("iframe", { "class": "cke_wysiwyg_frame cke_reset"})'자체 출력은 무엇입니까? –

답변

0

문제는 things.content이 개체와 같은 배열이 아닙니다. 따라서 iterable 인 데이터 유형으로 변환해야합니다. 당신이하는 일은 당신의 데이트 구조가 무엇인가에 달려 있습니다. 더 많은 코드를 보지 않으면 대부분의 대답은 Object.values(things.content)입니다.

관련 문제