{"id":20795,"date":"2021-02-27T19:26:13","date_gmt":"2021-02-28T00:26:13","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/scraping-html-content\/"},"modified":"2021-02-27T19:26:13","modified_gmt":"2021-02-28T00:26:13","slug":"scraping-html-content","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=20795","title":{"rendered":"Scraping HTML Content"},"content":{"rendered":"<p>HTML DOM Parser Works well: <a href=\"http:\/\/net.tutsplus.com\/tutorials\/php\/html-parsing-and-screen-scraping-with-the-simple-html-dom-library\/\">http:\/\/net.tutsplus.com\/tutorials\/php\/html-parsing-and-screen-scraping-with-the-simple-html-dom-library\/<\/a><br \/>\n<a href=\"http:\/\/sourceforge.net\/projects\/simplehtmldom\/\">http:\/\/sourceforge.net\/projects\/simplehtmldom\/<\/a><\/p>\n<p>PHP XML parsers will work though the HTML needs to be perfect (XHTML) : <a href=\"http:\/\/www.php.net\/manual\/en\/refs.xml.php\">http:\/\/www.php.net\/manual\/en\/refs.xml.php<\/a><\/p>\n<p>Example: <a href=\"http:\/\/www.php.net\/manual\/en\/simplexml.examples.php\">http:\/\/www.php.net\/manual\/en\/simplexml.examples.php<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>To grab HTML from a URL, you can use CURL<\/strong><\/p>\n<pre>        \/\/ create a new cURL resource\r\n\t$ch = curl_init();\r\n\r\n\t\/\/ set URL and other appropriate options\r\n\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\tcurl_setopt($ch, CURLOPT_USERPWD, \"username:password\");\r\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\t\r\n\r\n\t\/\/ grab URL and pass it to the browser\r\n\t$result = curl_exec($ch);\r\n\r\n\t\/\/ close cURL resource, and free up system resources\r\n\tcurl_close($ch);<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp; From: http:\/\/sitestree.com\/?p=556<br \/> Categories:Web Development, Root, By Sayed Ahmed<br \/>Tags:<br \/> Post Data:2013-11-18 02:03:36<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTML DOM Parser Works well: http:\/\/net.tutsplus.com\/tutorials\/php\/html-parsing-and-screen-scraping-with-the-simple-html-dom-library\/ http:\/\/sourceforge.net\/projects\/simplehtmldom\/ PHP XML parsers will work though the HTML needs to be perfect (XHTML) : http:\/\/www.php.net\/manual\/en\/refs.xml.php Example: http:\/\/www.php.net\/manual\/en\/simplexml.examples.php &nbsp; To grab HTML from a URL, you can use CURL \/\/ create a new cURL resource $ch = curl_init(); \/\/ set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=20795\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-20795","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":70099,"url":"http:\/\/bangla.sitestree.com\/?p=70099","url_meta":{"origin":20795,"position":0},"title":"Code Example: Utilizing Web Services in PHP #16","author":"Author-Check- Article-or-Video","date":"August 25, 2021","format":false,"excerpt":"PHP code to grab the best provincial mortgage rate:function find_mortgaze_rate($url){ \/\/ create a new cURL resource $ch = curl_init(); \/\/ set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERPWD, \"username:password\"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \/\/ grab URL and pass it to the browser $result = curl_exec($ch);\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":75870,"url":"http:\/\/bangla.sitestree.com\/?p=75870","url_meta":{"origin":20795,"position":1},"title":"PHP Topics to Learn","author":"Sayed","date":"August 1, 2023","format":false,"excerpt":"Identifiers https:\/\/docstore.mik.ua\/orelly\/webprog\/php\/ch02_01.htm#:~:text=An%20identifier%20is%20simply%20a,ASCII%200x7F%20and%20ASCII%200xFF. PHP Data Types https:\/\/www.odinschool.com\/learning-hub\/php\/datatypes Type Hinting https:\/\/www.honeybadger.io\/blog\/php-type-hinting\/#:~:text=Type%2Dhinting%20means%20explicitly%20stating,to%20write%20more%20robust%20code. PDO and MySQL https:\/\/www.w3schools.com\/php\/php_mysql_connect.asp PHP OOP https:\/\/www.w3schools.com\/php\/php_oop_what_is.asp abstract classes https:\/\/www.w3schools.com\/php\/php_oop_classes_abstract.asp Abstract vs Interface https:\/\/www.w3schools.com\/php\/php_oop_interfaces.asp#:~:text=PHP%20%2D%20Interfaces%20vs.%20Abstract%20Classes&text=Interfaces%20cannot%20have%20properties%2C%20while,abstract%20keyword%20is%20not%20necessary , methods, interfaces, and inheritance Pillars of OOP The Four pillars of OOPs, abstraction, encapsulation, inheritance, and polymorphism, are integral to understanding and using OOP https:\/\/datatrained.com\/post\/four-pillars-of-oops\/#:~:text=The%20Four%20pillars%20of%20OOPs%2C%20abstraction%2C%20encapsulation%2C%20inheritance%2C,to%20understanding%20and%20using%20OOP. Four\u2026","rel":"","context":"In &quot;PHP&quot;","block_context":{"text":"PHP","link":"http:\/\/bangla.sitestree.com\/?cat=1427"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7983,"url":"http:\/\/bangla.sitestree.com\/?p=7983","url_meta":{"origin":20795,"position":2},"title":"PHP \u098f\u09b0 \u09ac\u09cd\u09af\u09be\u09b8\u09bf\u0995 \u09a7\u09be\u09b0\u09a8\u09be \u0964 Basic Concepts on PHP Programming Language","author":"Author-Check- Article-or-Video","date":"March 29, 2015","format":false,"excerpt":"PHP \u098f\u09b0 \u09ac\u09cd\u09af\u09be\u09b8\u09bf\u0995 \u09a7\u09be\u09b0\u09a8\u09be \u0964 PHP \u098f\u09b0 \u09ac\u09cd\u09af\u09be\u09b8\u09bf\u0995 \u09a7\u09be\u09b0\u09a8\u09be \u0964 \u0986\u099c \u0986\u09aa\u09a8\u09be\u0995\u09c7 \u0993\u09df\u09c7\u09ac\u09a1\u09bf\u099c\u09be\u0987\u09a8\u09c7\u09b0 \u0985\u09a8\u09c7\u0995 \u0997\u09c1\u09b0\u09c1\u09a4\u09cd\u09ac\u09aa\u09c1\u09b0\u09cd\u09a3 \u09ad\u09be\u09b7\u09be PHP \u09a8\u09bf\u09df\u09c7 \u0986\u09b2\u09cb\u099a\u09a8\u09be \u0995\u09b0\u09ac\u09cb \u0964 PHP \u0995\u09bf? PHP \u0995\u09bf \u09ac\u09b2\u09be\u09b0 \u0986\u0997\u09c7 \u09ac\u09b2\u09c7 \u09a8\u09c7\u0987 PHP \u09b6\u09bf\u0996\u09a4\u09c7 \u0997\u09c7\u09b2\u09c7 \u0986\u09aa\u09a8\u09be\u0995\u09c7 \u0986\u0997\u09c7 \u0995\u09bf \u0995\u09bf \u099c\u09be\u09a8\u09a4\u09c7 \u09b9\u09ac\u09c7 \u0964 \u09e7\u0964 HTML \u09e8\u0964 CSS \u09e9\u0964 JavaScript \u098f\u0987 \u09a4\u09bf\u09a8\u099f\u09bf \u09ad\u09be\u09b7\u09be \u09a8\u09be \u099c\u09be\u09a8\u09b2\u09c7\u2026","rel":"","context":"In &quot;\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf\/PHP&quot;","block_context":{"text":"\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf\/PHP","link":"http:\/\/bangla.sitestree.com\/?cat=261"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70059,"url":"http:\/\/bangla.sitestree.com\/?p=70059","url_meta":{"origin":20795,"position":3},"title":"PHP: How to Execute  Remote Scripts\/Services #16","author":"Author-Check- Article-or-Video","date":"August 24, 2021","format":false,"excerpt":"$url is the URL to execute$url = $_GET['url'];$file = fopen ($url, \"r\");if (!$file){echo \"Error.n\";}else{header('Content-Type: text\/xml');while (!feof ($file)){$line = fgets ($file, 1024);echo $line;}}fclose($file);How to pass information from JavaScript to PHP\/JSP - mix of PHP and JavaScript \/\/we are passing some value say 15 from JavaScript to PHPlocation.href=\"?xyz=15\"; fsockopen$fp = fsockopen(\"$urlToExecute\"); if\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7996,"url":"http:\/\/bangla.sitestree.com\/?p=7996","url_meta":{"origin":20795,"position":4},"title":"\u09aa\u09bf\u098f\u0987\u099a\u09aa\u09bf 5 \u09aa\u09b0\u09bf\u099a\u09bf\u09a4\u09bf \u0964 PHP5","author":"Author-Check- Article-or-Video","date":"March 29, 2015","format":false,"excerpt":"\u09aa\u09bf\u098f\u0987\u099a\u09aa\u09bf 5 \u09aa\u09b0\u09bf\u099a\u09bf\u09a4\u09bf \u0964 \uf076 \u09aa\u09bf\u098f\u0987\u099a\u09aa\u09bf \u0995\u09bf ? \u2022 \u09aa\u09bf\u098f\u0987\u099a\u09aa\u09bf \u098f\u0995\u099f\u09bf \u09ac\u09cd\u09af\u09be\u09aa\u0995 \u09ac\u09cd\u09af\u09ac\u09b9\u09c3\u09a4 , \u0993\u09aa\u09c7\u09a8 \u09b8\u09cb\u09b0\u09cd\u09b8 \u09b8\u09cd\u0995\u09cd\u09b0\u09bf\u09aa\u09cd\u099f\u09bf\u0982 \u09ad\u09be\u09b7\u09be\u0964 \u2022 \u09aa\u09bf\u098f\u0987\u099a\u09aa\u09bf \u098f\u0995\u099f\u09bf \u0986\u09a6\u09cd\u09af\u0995\u09cd\u09b7\u09b0 \" \u09aa\u09bf\u098f\u0987\u099a\u09aa\u09bf: \u09b9\u09be\u0987\u09aa\u09be\u09b0\u099f\u09c7\u0995\u09cd\u09b8\u099f \u09aa\u09cd\u09b0\u09b8\u09c7\u09b8\u09b0\u0964 \u2022 \u09aa\u09bf\u098f\u0987\u099a\u09aa\u09bf \u09ac\u09bf\u09a8\u09be\u09ae\u09c2\u09b2\u09cd\u09af\u09c7 \u09a1\u09be\u0989\u09a8\u09b2\u09cb\u09a1 \u09af\u09cb\u0997\u09cd\u09af\u0964 \u09aa\u09bf\u098f\u0987\u099a\u09aa\u09bf \u098f\u0995\u099f\u09bf \u09ac\u09bf\u09b8\u09cd\u09ae\u09af\u09bc\u0995\u09b0 \u098f\u09ac\u0982 \u099c\u09a8\u09aa\u09cd\u09b0\u09bf\u09af\u09bc \u09ad\u09be\u09b7\u09be ! \u098f\u099f\u09bf \u0993\u09af\u09bc\u09c7\u09ac (\u0993\u09af\u09bc\u09be\u09b0\u09cd\u09a1\u09aa\u09cd\u09b0\u09c7\u09b8 ) \u0989\u09aa\u09b0 \u09b8\u09ac\u099a\u09c7\u09af\u09bc\u09c7 \u09ac\u09a1\u09bc \u09ac\u09cd\u09b2\u0997\u09bf\u0982 \u09b8\u09bf\u09b8\u09cd\u099f\u09c7\u09ae \u098f\u09b0 \u09ae\u09c2\u09b2 \u09b9\u09a4\u09c7\u2026","rel":"","context":"In &quot;\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf\/PHP&quot;","block_context":{"text":"\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf\/PHP","link":"http:\/\/bangla.sitestree.com\/?cat=261"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9598,"url":"http:\/\/bangla.sitestree.com\/?p=9598","url_meta":{"origin":20795,"position":5},"title":"\u0987\u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u09aa\u09cd\u09b0\u09b8\u09c7\u09b8 \u09ae\u09cd\u09af\u09be\u09a8\u09c7\u099c\u09ae\u09c7\u09a8\u09cd\u099f (Unix &#8211; Processes Management)","author":"Author-Check- Article-or-Video","date":"July 1, 2015","format":false,"excerpt":"\u09b0\u09bf\u09a6\u0993\u09df\u09be\u09a8 \u09ac\u09bf\u09a8 \u09b6\u09be\u09ae\u09c0\u09ae \u00a0 \u0987\u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u09b8\u09bf\u09b8\u09cd\u099f\u09c7\u09ae\u09c7 \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u09b0\u09be\u09a8 \u0995\u09b0\u09be\u09a8\u09cb\u09b0 \u09b8\u09ae\u09df \u09b8\u09bf\u09b8\u09cd\u099f\u09c7\u09ae \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae\u09c7\u09b0 \u0989\u09aa\u09af\u09c1\u0995\u09cd\u09a4 \u09aa\u09b0\u09bf\u09ac\u09c7\u09b6 \u09a4\u09c8\u09b0\u09bf \u0995\u09b0\u09c7 \u09a8\u09c7\u09df\u0964 \u0985\u09aa\u09be\u09b0\u09c7\u099f\u09bf\u0982 \u09b8\u09bf\u09b8\u09cd\u099f\u09c7\u09ae pid \u09ac\u09be \u09aa\u09cd\u09b0\u09b8\u09c7\u09b8 \u0986\u0987\u09a1\u09bf \u09a6\u09cd\u09ac\u09be\u09b0\u09be \u09aa\u09cd\u09b0\u09b8\u09c7\u09b8\u0995\u09c7 \u099f\u09cd\u09b0\u09cd\u09af\u09be\u0995 \u0995\u09b0\u09c7\u0964 \u00a0 \u09aa\u09cd\u09b0\u09b8\u09c7\u09b8 \u09b6\u09c1\u09b0\u09c1 \u0995\u09b0\u09be \u09aa\u09cd\u09b0\u09b8\u09c7\u09b8 \u09b6\u09c1\u09b0\u09c1 \u09ac\u09be \u09b0\u09be\u09a8 \u0995\u09b0\u09be\u09a8\u09cb\u09b0 \u09b8\u09ae\u09df \u09a6\u09c1\u0987 \u09ad\u09be\u09ac\u09c7 \u0986\u09ae\u09b0\u09be \u098f\u099f\u09bf \u0995\u09b0\u09a4\u09c7 \u09aa\u09be\u09b0\u09bf, \u09ab\u09cb\u09b0\u0997\u09cd\u09b0\u09be\u0989\u09a8\u09cd\u09a1 \u09aa\u09cd\u09b0\u0995\u09cd\u09b0\u09bf\u09df\u09be\u09df \u0993 \u09ac\u09cd\u09af\u09be\u0995\u0997\u09cd\u09b0\u09be\u0989\u09a8\u09cd\u09a1 \u09aa\u09cd\u09b0\u0995\u09cd\u09b0\u09bf\u09df\u09be\u09df \u00a0 \u09ab\u09cb\u09b0\u0997\u09cd\u09b0\u09be\u0989\u09a8\u09cd\u09a1\u2026","rel":"","context":"In &quot;\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix&quot;","block_context":{"text":"\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix","link":"http:\/\/bangla.sitestree.com\/?cat=1231"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/20795","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20795"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/20795\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20795"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}