मैं कोशिश कर रहा हूँ निकालने के लिए मूल्य का एक छिपा इनपुट टैग में. भले ही तत्व मौजूद है 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)
मैं सराहना करते हैं, किसी भी तरह की मदद के रूप में यह वास्तव में मुझे परेशान. आप पहले से धन्यवाद!