1. 程式人生 > >python+selenium利用線上程式碼轉換工具,批量定位百度頁面元素https://www.sojson.com/jshtml.html(附操作步驟)

python+selenium利用線上程式碼轉換工具,批量定位百度頁面元素https://www.sojson.com/jshtml.html(附操作步驟)

一、定位一組元素如下圖

在這裡插入圖片描述 二、選擇copy element複製頁面元素

<div id="u1"><a href="http://news.baidu.com" name="tj_trnews" class="mnav">新聞</a><a href="https://www.hao123.com" name="tj_trhao123" class="mnav">hao123</a><a href="http://map.baidu.com" name="tj_trmap" class="mnav">地圖</a><a href="http://v.baidu.com" name="tj_trvideo" class="mnav">視訊</a><a href="http://tieba.baidu.com" name="tj_trtieba" class="mnav">貼吧</a><a href="http://xueshu.baidu.com" name="tj_trxueshu" class="mnav">學術</a><a href="https://passport.baidu.com/v2/?login&amp;tpl=mn&amp;u=http%3A%2F%2Fwww.baidu.com%2F&amp;sms=5" name="tj_login" class="lb" onclick="return false;">登入</a><a href="http://www.baidu.com/gaoji/preferences.html" name="tj_settingicon" class="pf">設定</a><a href="http://www.baidu.com/more/" name="tj_briicon" class="bri" style="display: block;">更多產品</a><div class="bdnuarrow bdbriarrow" style="display: block;"></div></div>

三、利用線上工具進行轉換https://www.sojson.com/jshtml.html 在這裡插入圖片描述

四、線上工具轉換完成後,批量定位元素,自行輸出css定位