Thứ Sáu, 9 tháng 11, 2012

XPATH and Madcow

Madcow relies heavily on XPATH.
It is usually used in the mappings files. Like this one in the search.grass file.

searchButton.xpath=//button[@type='submit']

Therefore it is important to have a good understanding of how to use xpath.
Here is some good links to read up about it.
https://www.w3schools.com/xml/xpath_intro.asp

There are also a few plugins for your web browsers, which you can run to test your xpath code.
So if you haven't already got one then you should look at getting one also.
Here are a few links…
https://chrome.google.com/webstore/detail/xpath-helper/hgimnogjllphhhkhlmebbmlgjoejdpjl
https://chrome.google.com/webstore/detail/xpath/lbghbpofdlcecfbpjgmffnkieenjkboi/details
https://addons.mozilla.org/en-US/firefox/addon/xpather/

Also here is a good tip too:
You can use $x in the Chrome javascript console. No extensions needed.

ex: $x("//img")

Also the search box in the web inspector will accept xpath

Không có nhận xét nào:

Đăng nhận xét

Học lập trình web căn bản với PHP

Bài 1: Các kiến thức căn bản Part 1:  https://jimmyvan88.blogspot.com/2012/05/can-ban-lap-trinh-web-voi-php-bai-1-cac.html Part 2:  https://...