我有一个带有CDATA标记的HTML源代码,其中包含一些我想要的信息。你知道吗
当我尝试以下操作时:
switch_url = switch_soup.find_all(text=re.compile(('Switches')))
我得到这个输出:
['//<![CDATA[\n "url":"https://xxxx.meraki.com/xxxxxxx/n/xxxxx/manage/nodes/list","name":"Switches","admin_only":false},{"is_current":false,"url":"https://nxx.meraki.com/xxxxx/n/xxxxx/manage/configure/switchports","name":"Switch ports","admin_only":false},{"is_current":false,"url":"https://xxxx.meraki.com/Dormitory/n/xxxxxxx/manage/configure/dhcp_servers"//]]>\n ']
如何从CDATA输出中获取“Switches”url,即:“https://xxxx.meraki.com/xxxxxxx/n/xxxxx/manage/nodes/list”?你知道吗
提前谢谢!你知道吗
你需要的是这个
或者你可以试试这个
相关问题 更多 >
编程相关推荐