Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have tried this code but it didn't work. Please help me with this.

PHP
$.get("http://www.agriculture.com/markets",function (data)
{
$("#myMarketData).html(data.(".section section-market"))
});
Posted

Hi, you can use Jquery "find", hope this help you
JavaScript
$.get('http://www.agriculture.com/markets',function (data)
{
     $('#myMarketData').html($(data).find('.section section-market').html());
});
 
Share this answer
 
Comments
F-ES Sitecore 24-Jun-15 4:07am    
I think anpxbkhn probably meant this

$.get('http://www.agriculture.com/markets',function (data)

Sometimes the text editor wraps links in "a" tags when you don't want it to.
as i know you need to do scraping of that page and then you need to fetch that div using looping if needed


this may help you http://www.aspnettutorials.com/tutorials/network/net-webpage-aspnet2-csharp/[^]


Scraping HTML DOM elements using HtmlAgilityPack (HAP) in ASP.NET[^]
 
Share this answer
 
Comments
Member 11752343 24-Jun-15 3:14am    
i tried that thing also but this will also fetch the whole website not a particular div.
Member 11752343 24-Jun-15 3:18am    
and one more thing i want to clear that webrequest and webresponse are the things in which i have to ask the website's owner that i want to take data from there website.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900