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
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());
});