URLにajax呼び出しを行い、結果としてpタグのみを使用しようとしています。これをどのように実装できますか?例えばAjaxのWebサイトURLへの呼び出し、結果を解析して段落タグを取得する方法
私が持っている場合:
$.get("www.foobar.com",function(result){
console.log(result)
});
//this will return all the html contents of foobar.com as a string so I might get <html><head></head><body> <h1>foobar</h1><h3>Some Text</h3><p>Hello World</p><br><p> this is a cool site</p>
しかし、私は唯一のPタグの内容(Hello Worldのを、これはクールなサイトです)したい私はこれをどのように行うことができますか?