Use css and xpath to locate elements in the browser's Console

the goal

Insert picture description here

instruction

Open the Baidu page and enter in the browser's console according to the positioning method

css:$$('#su')
xptah:$x('//*[@id="su"]')
dom树:dom:document.querySelectorAll('[id="su"]')

Preview

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_39740094/article/details/115380698