I'm not sure if this will be possible, but is there any way to extract the dynamic link under this webpage: http://www.mobileonline.tv/channel.php?n=69111 the dynamic link is named "Link 1 (HLS): not compatible with all channels" thanks
I suppose, besides xss, the only easy way is by
going to that page,
right clicking on that link,
click on inspect element.
The anchor tag should be highlighted for you in the developer tool. You can find the url in the href attribute of the anchor tag.
Related
I am trying to scrape website data and I can look for a tags that I want to explore.
However, this tags are like <a title="Annex" href="https://www.myite.com/d…-3.pdf?sfvrsn=b3a84558_2" sfref="[documents|librariesProv…-4ef8-8b90-ae20b6b7590d">
getting a.href just returns https://www.myite.com/d…-3.pdf?sfvrsn=b3a84558_2 and that results in 404 page.
However, when I click on the tag on web page it opens pdf - the url is slightly modified.
How to handle these types of links in javascript. I am using js fetch similar to this post.
Thanks in advance.
sfref is an attribute that is used to resolve dynamic links. For example, when the a tag is cliked, the sfref attribute value is used to build href on the fly.
I assume you do not have the access to the logic used for link resolution.
The best thing you can do here is to tuse Chrome Dev Tools -> Event Listeners and find out the event where the link resolution happens.
Please keep in mind that different a tags might have a different resolution logic attached to them.
How do I get all hrefs(links) that reside in anchor tags with JavaScript code using selenium python? Those links are dynamically changed every time.
this is the tag i have used to click:enter image description here
i got all the anchor tags inside that webpage, but for above anchor tag i got output like this
javascript:selectItem('/7000/7020.aspx?reqID=' + ContentPH_hidReqID.getValue() + '&wf=0' + addUrlText() + '#ContentPH_tabReq:ContentPH_pnlCandidates')
Anyone can help me out how to get those type of links on webpage using selenium python.
Thanks in advance
himabindu y
You want to use this to find all anchor link elements on the page that have href
driver.find_elements_by_css_selector("a[href]");
I am trying to do a simple cross reference hyperlink, as in "see 'checkboxes' under the 'ui controls' section", which in plain html might be <a href="uicontrols.html#checkboxes">
In my ui-router-based app, I am trying to use
checkboxes
to go to the state/page elements.uicontrols and then the anchor tag on that page.
It doesn't work, and some Googling turned up this: https://github.com/angular-ui/ui-router/pull/1867
Does anyone know a way to accomplish links like this?
You can try it may be solved your problem. you should use id in anchor tag of plain html page to create reference link.
In ui-router-based app
<a ui-sref="elements.uicontrols({'#':'checkboxes'})">checkboxes</a>
in plain html might be
<a id="checkboxes" href="uicontrols.html">check to another page link</a>
N.B: should have sufficient content bellow the plain anchor tag to show that anchor tag at the top.
I have published a Google Document that contains some links. I have used the iframe code to embed it on a webpage. However, when clicking on its links, the iframe is being replaced by the link's target url.
I have tried to dynamically download the frame and replace a div placeholder (ajax + jquery), but it's not an elegant solution as there is basically an html document embedded on the parent html document. ( I have other problems with this approach)
I have also tried using the tag:
<base target="_blank">
but it doesn't work.
Another failed attempt was by using the onload attribute of the iframe element.
Then with jQuery I was trying to modify the target of all the a elements.
Any help? Thanks in advance!
Duplicate question. Workaround, An old one, On SO
Force iFrame links (in embedded Google Doc) to open in new window
Google docs requests for an answer Here
I am loading an HTML content parsed from an email to a frame. If the email contains an href link, it tries to open the link in its frame but I'd like to make it open in a new tab.
Normally, I'd do this by setting the target to _blank in the href, but the href tags are being read straight from the EML files, so unless if there's a better way, it seems like the only way I can accomplish this is to parse the HTML tags that is being read, find all href links and add the target to it. If possible, I'd like to avoid this option because parsing html adds a lot of downside to performance in general.
If anyone knows an elegant way of achieving this, please let me know.
This is not very elegant or semantic, but as a quick and dirty solution you can print a base tag before the first link:
<base target="_blank">
See http://www.w3schools.com/tags/att_base_target.asp for more info.
If you're using jQuery...
$('#frame a').click(function(event) {
event.preventDefault();
window.open($(this).attr('href'), '_blank');
});