-
Using JavaScript
# fetch URLs $('css_selector').attr('href') document.querySelector('css_selector').href $('css_selector').prop("href") href = 'http://google.com' # in the new tab or window window.open(href) # in the current window window.location = href
-
Using HTML
<a href="http://www.google.com/" target="_blank">Visit Google</a>
-
Splinter
selector = "'#CSS'" element = 'document.querySelector('+selector+')' url_script = element + '.href' href_script = element + ".getAttribute('href')" #import ipdb; ipdb.set_trace(); href = context.browser.evaluate_script(href_script) url = context.browser.evaluate_script(url_script)
Last active
August 29, 2015 14:01
-
-
Save ldong/62c3ad0600cb41c3b7b6 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment