对于noob的html抓取问题很抱歉,但我处理的是复杂的html,每种情况都是独一无二的
我正试图解析出前面的所有URL:{“actionType”:“navigate”,“actionUrl”:
在下面的例子中,它将是https://www.ABCD.com
我正在使用python。最好是漂亮的汤。关于如何处理的想法
</a>
<a aria-label="ABCD." class="we-lockup targeted-link l-column small-2 medium-3 large-2 we-lockup--shelf-align-top ember-view" data-metrics-click='{"actionType":"navigate","actionUrl":"https://www.ABCD.com","targetType":"card","targetId":"12345"}' data-metrics-location='{"locationType":"shelfCustomersAlsoBoughtMovie"}' href="https://www.ABCD.com" id="ember123"> <picture class="we-lockup__artwork we-artwork--lockup we-artwork--fullwidth we-artwork--vhs-movie-pic we-artwork ember-view" dir="ltr" id="ember123">
<noscript>
您可以使用内置的
json
模块将数据转换为Python字典(dict
),然后访问actionUrl
键输出:
相关问题 更多 >
编程相关推荐