나를 추출하기 위해 노력하고 가치의 숨겨진 입력된 태그입니다. 도 하지만 요소가 존재하에서는 HTML 나는 그것을 찾을 수 없습니다로 bs4.
이것은 오류 메시지가 나를 얻을:
AttributeError: 'NoneType' object has no attribute 'find'
이것은 html 웹 페이지에서:
<form id="exampleid" class="exampleclass" action="/ex/ex-ex/ex/2" method="post">
<more html>
<div>
<input type="hidden" name="csrf" value="abcdefghijklmnopqrstuvwxyz">
</div></form>
이것은 현재 내 코드:
csrf = soup.find("form", {"id": "exampleid"})
csrf = csrf.find('input', {'name': 'csrf'}).get("value")
print(csrf)
나는 감사하는 모든 종류의 도움으로 그것이 정말로 괴롭다. 사전에 감사합니다!