0

I have a page at http://www.entrepreneuronfire.com/podcast/edwinhavens/

With an image at https://i.stack.imgur.com/VTGVC.png

I need to get the download link (i.e. hxxp://traffic.libsyn.com/entrepreneuronfire/Edwin_Havens.mp3) of the MP3 file at class named spp-dloada(as web inspector detects) but all my 48 hours attempt ended in smoke.

That download link shows well in chrome (as

<a href="http://traffic.libsyn.com/entrepreneuronfire/Edwin_Havens.mp3" download="Edwin_Havens.mp3">
    <span class="spp-dloada"></span>
</a>

) but not in FireFox 38 and IE11 but i need them in these two browser.

For FireFox and IE11 HTML Snippet is

<div class="spp-controls">
<span class="spp-speed"/>
<span class="spp-share">
<div class="spp-share-options" style="display: none;">
    <a class="spp-share-icon spp-twitter-btn" href="">Share</a>
    <a class="spp-share-icon spp-fb-btn" href="">Share</a>
    <a class="spp-share-icon spp-gplus-btn" href="">Share</a>
    <!--<a href="" class="spp-share-icon spp-email-btn">Share</a>-->
</div>
</span>
<span class="spp-dload"/>
<span class="spp-play"/>

Oddest thing is when i click on the download button (as shown in the above image) iframe changes into

<iframe class="spp-downloader" style="display:none" src="http://www.entrepreneuronfire.com?spp_download=http://traffic.libsyn.com/entrepreneuronfire/Edwin_Havens.mp3"/>

What have tried so far are-

Software:firebug, temper data,modifyheaders

Language:XPATH, CCS Selector, Jquery

EDIT ---- Sorry for belated adjunct

I need pure XPATH expression too SINCE DIFFERENT BROWSER BEHAVES DIFFERENTLY


N.B. HTML SNIPPET IS FOR CHROME ONLY

  • You mention "MP3 file at class named spp-play", but your HTML snippet doesn't include that class. Can you clarify? – LarsH Jun 20 '15 at 01:07
  • Sir i changed the Question a bit –  Jun 20 '15 at 08:13
  • I see all you are trying to answer after a glance at the question not going through the details even i commented hereafter. –  Jun 21 '15 at 05:15

2 Answers2

1

The span inside of the link has a class, so you can just grab the parents 'href' attribute using jQuery like so:

$('.spp-dloada').parent().attr('href');

Fiddle

(This is of course assuming you have access to modify the code on this website.)

RE: Edit

It doesn't look like IE supports XPath, according to the answers here: jquery select element by xpath

Community
  • 1
  • 1
rch
  • 91
  • 2
  • 7
1

If you view the source of the page, you can see that the source is different from the generated source you see when you inspect the element.

The link you are trying to fetch is not in the actual page source, however, this is:

<div class="smart-track-player  stp-color-ff6100" data-url="http://traffic.libsyn.com/entrepreneuronfire/Edwin_Havens.mp3" data-download="true"data-color="ff6100" data-title="Edwin Havens" data-artist="John Lee Dumas chats with" data-uid="IU5Uvc7G" ></div>

I'm guessing the page then has some Javascript functionality which generates a clickable link from this markup.

Try using this jQuery code to access the download url:

$('.smart-track-player').attr('data-url');

An XPath expression to fetch this node would be something like this:

//div[@class='smart-track-player  stp-color-ff6100']
HaukurHaf
  • 13,522
  • 5
  • 44
  • 59
  • Ahh, -Sir, //div[@class='smart-track-player stp-color-ff6100'] does not work in mozilla XPath Checker. and i do not want to evaluate chrome html rather FireFox XPath. –  Jun 19 '15 at 23:25
  • @SheriffAzleum: clarify "does not work." Throws an error? Gives a wrong result? what error/result? And why do you care about XPath Checker? The XPath expression he gave is valid (although it's sensitive to any changes in whitespace). – LarsH Jun 20 '15 at 01:06
  • @ LarsH Sir my question includes "but not in FireFox 38 and IE11 but i need them in these two browser"- i mean i need in FF and IE not chrome. So the answer works well in chrome not the other two. –  Jun 20 '15 at 07:29
  • @SheriffAzleum: Could you answer the question about what "does not work" means? – LarsH Jun 21 '15 at 08:31