Safari's Web Inspector lets you do XPath queries from the search box:
But the box is too small! You can use it but not comfortably.
Is it possible to do the XPath query from the console prompt shown on the bottom of the screenshot?
I think in the console of Chrome or Firefox or Safari you can evaluate XPath expressions with the function $x e.g. $x('//span') selects all span elements.
Related
I am using latest fireFox version and not able to turn on firebug. It is showing deactivated. can anyone help me how to activate it? As I am not able to search xpath.
Firebug is no longer available in Firefox, now replaced by the Firefox Developer Tools. There's a guide for migrating.
What you are seeing are actually the Firefox DevTools. When opening it the first time, there is a hint explaining the transition a little:
Note that even the Firebug toolbar button disappears with the release of Firefox 57. The backgrounds are outlined in a related blog post.
Unfortunately, the DevTools do not provide an XPath search within their Inspector yet. There's an enhancement request filed for this feature, though.
Having said that, you can at least copy the XPath to an element via the context menu:
Furthermore, if you need the XPath for automated testing like Selenium, you can use CSS selectors in most cases instead, which can be searched for using the search field.
It's possible to take screenshots of web pages in Firefox using the developer toolbar. Is it possible to do this programmatically too, e.g., from the command line? I've tried with Selenium, but with no luck.
edit: I know it's possible to take screenshots using Selenium, but this only gets you the full screen. Using the developer toolbar in Firefox, one can use CSS selectors to select only parts of a page, which is what I want to do (and forgot to specify, sorry). What I've read online is that Selenium cannot access the developer toolbar because it's not part of the DOM.
I'd like to scrape a website that dynamically generates more content as I scroll down the web browser. I have seen a related post, Auto-Scroll in FireFox, but it doesn't answer my question.
Is it possible to scroll a webpage until the end of page (no more content is generated by the web server) or until a few refreshes using Watir web-driver?
I have recently tried to do something like that, and to my surprise looks like webdriver does not have support for scrolling. I did find two workarounds.
This will send space to the browser, and it will scroll down (works on twitter.com, for example):
browser.send_keys :space
This will scroll to the element, and if the element is at the bottom of the page, it will load more content:
browser.element.wd.location_once_scrolled_into_view
Using ColorZilla I found an interesting feature. If I pick a color from firefox (bars,tabs or anything else of the browser) and then go to:
ColorZilla > Inspect Last Element > In
Firebug
Then I can see the markup,css,js that firefox uses in the firebug panel just like a website.
Is there any solution to view this code without use Colorzilla?
As mentioned in the comments, Chromebug is no longer working with current Firefox versions. Instead of opening the limited chrome://browser/content/browser.xul page, you can make the browser chrome accessible to the scratchpad. Open the about:config page and set devtools.chrome.enabled to true, as described in the extension development environment setup guide on MDN.
Open the JavaScript scratchpad (Shift+F4) and select the browser context environment. Now you can type in something like window or document.getElementById('urlbar') and click the inspect button or hit Ctrl+i. This will evaluate the expression and open the element inspector, which shows all properties of the element.
It sounds like you're after Chromebug.
Chromebug is the Firebug code adapted
for XUL applications. It is the
debugger that Firebug developers use
to develop Firebug.
So you can debug your debugger, you know?
Instructions: http://getfirebug.com/wiki/index.php/Chromebug
There is actually a dedicated version of Firebug for that called Chromebug (Named after the chrome of Firefox, not Google's chrome)
Is there anything for IE that would allow me to edit attributes of DOM elements live, like Firebug does for Firefox? So far, I have only found DOM inspectors - Developer Toolbar, DebugBar, Firebug Lite. None of them allow editing the elements, only looking up/highlighting them :(
What about
IE WebDeveloper
IE WebDeveloper is an add-on for
Microsoft Internet Explorer. The rich
web debugging toolset allows you to
inspect and edit the live HTML DOM and
current cascaded styles, evaluate
expressions and display error
messages, log messages, explore source
code of webpage and monitor DHTML
Event and HTTP Traffic.
IE DOM Inspector
IE DOM Inspector is a plug-in for
Microsoft Internet Explorer that
allows you to inspect and edit the
live HTML DOM of any web document.
I use IE developper toolbar for IE