Xpath tools: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
Line 36: Line 36:
# Open the Command Palette
# Open the Command Palette
#* Menu: Tools -> Command Palette
#* Menu: Tools -> Command Palette
#* or press the keyboard key: {{kbd | key=ctrl + shift + p}} on {{Win}} or {{kbd | key=command + shift + p}} on {{Mac}})
#* or press the keyboard shortcut<ref>[https://stackoverflow.com/questions/45586508/sublime-text-xpath-plugin-shortcut sublimetext3 - Sublime Text - XPath Plugin shortcut - Stack Overflow]</ref>: {{kbd | key=ctrl + shift + p}} on {{Win}} or {{kbd | key=command + shift + p}} on {{Mac}})
# and select {{kbd | key=Xpath: Query document}}
# and select {{kbd | key=Xpath: Query document}}
# input the Xpath expression
# input the Xpath expression

Revision as of 11:09, 13 July 2021

List of tools for xpath expression selection/query

chrome javascript console

Chrome Browser chrome.png javascript console

  1. 選單: 工具 -> 開發人員工具 -> Console
  2. 確認符合 XPath 規則的結果,例如 XPath 規則是 "//img",可在 Console 輸入 $x("//img") ,按 Enter。就會顯示符合 xpath 規則的結果[1][2]

15103179455_c452b70923.jpg

image hosted by flickr

chrome extension

XPath Helper

  1. 輸入 ctrl + shift + x 或點選工具列上的 x 圖示,開啟 XPath Helper console (顯示在網頁上方)
  2. 輸入 xpath 規則。就會凸顯符合 xpath 規則的網頁元件地方

15102884872_509e9559f6.jpg

image hosted by flickr


Natu WebSync - Chrome 線上應用程式商店

  1. 開啟「開發人員工具」
  2. 點選標籤「WebSync」-> 輸入 xpath 規則

firefox extension

Firebug + FirePath for Firefox browser_firefox.png

  1. 選單: 工具 --> 網頁開發者 --> Firebug --> 開啟 Firebug
  2. 切換到 FirePath 標籤
  3. 輸入 xpath 規則。就會凸顯符合 xpath 規則的網頁元件地方

Sublime text editor

xpath - Packages - Package Control: "Sublime Text plugin for easier cursor navigation of XML and HTML files using XPath 1.0."

Steps

  1. Open the Command Palette
    • Menu: Tools -> Command Palette
    • or press the keyboard shortcut[3]: ctrl + shift + p on Win Os windows.png or command + shift + p on Mac icon_os_mac.png )
  2. and select Xpath: Query document
  3. input the Xpath expression

Other tools

References

  • References

Related articles


Troubleshooting of ...

Template