I would like to know how can I get the url from the address bar in a browser, I would like to do it preferably in the most popular browsers like firefox, chrome, edge, opera etc.
The code from this snswer from stack overflow answer https://stackoverflow.com/a/19296923/11337328 does what I want but only works for Internet Explorer, I don't understand the code, how it is getting that info though.
If someone knows how can I do that for other browsers please help. Thank you.
most browsers have some sort of plugin interface and there should be a way to tap the data you need from it: that seems like a very basic piece of info.
trying to back-hack the gui to steal a piece of info is difficult and aggravating; it is a last resort that is bug prone (updates to the browser can break your code) and can even trigger some anti virus etc.
@salem c
The webdriverxx always throws an expcetion( what() : Cannot perform HTTP request (result: 7, message: Failed to connect to localhost port 4444: Connection refused )
And still, by looking at some of its code examples I couldn't understand how that would help on my problem.