Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is it possible to retrieve a certain value from a website using jQuery web scraping?

I am trying to read a value from a website using web scrapping

The Site I am trying to read is

https://nseguide.com/stock.php?TATASTEEL

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I am trying to read Support 1 value from here which is 106.9

`

I am getting the error

Uncaught Error: Syntax error, unrecognized expression:
//*[@id="left-col"]/div[4]/table/tbody/tr[3]/td[4]/b

This is what i tried

$(document).ready(function(){


$.get('https://nseguide.com/stock.php?TATASTEEL', function(html) {

  alert($(html).find('//*[@id="left-col"]/div[4]/table/tbody/tr[7]/td[4]').text());

});

});

I copied the xpath value using chrome inspect , pls let me know how to resolve this

>Solution :

Yon are not using jquery syntax to go to the element, try this:

$.get("https://nseguide.com/stock.php?TATASTEEL", function (html) {
     alert($(html).find(".stocks.box table tr:eq(5) td:eq(3)").text());
});
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading