ฉันกำลังพยายามคลายแฟ้มค่าของที่ถูกซ่อนข้อมูลป้ายกำกับ ถึงแม้ว่าห้องธาตุอยู่ใน 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)
ฉันจะซาบซึ้งมากเกี่ยวกับเรื่องช่วยเท่าที่มันเป็นจริงรบกวนจิตใจผม ขอบคุณล่วงหน้า!