The following code gives the expected results:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Generate Description and Tags</title>
</head>
<body>
<?php
include 'simple_html_dom.php';
$entityURL = "http://google.com";
echo "Entity URL: ", $entityURL,"
";
$html = file_get_html($entityURL);
$tot_html_str = $html->save();
$tot_html_strlen = strlen($tot_html_str);
echo "Strlen of total HTML: ",$tot_html_strlen,"
";
?>
</body>
</html>
results in:
Entity URL: http://google.com
Strlen of total HTML: 7403
However, if I read the URL from a file, I am not able to scrape the HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Generate Description and Tags</title>
</head>
<body>
<?php
include 'simple_html_dom.php';
$myFile = "/home/prakash/foo.txt";
$src_handle = fopen($myFile, "r");
$entityURL = fgets($src_handle, 4096);
echo "Entity URL: ", $entityURL,"
";
$html = file_get_html($entityURL);
$tot_html_str = $html->save();
$tot_html_strlen = strlen($tot_html_str);
echo "Strlen of total HTML: ",$tot_html_strlen,"
";
?>
</body>
</html>
results in:
Entity URL: http://google.com
Strlen of total HTML: 0
What do I need to do differently to read the URL from a file.
UTL File problem
Hi
Help with setcookie()
Merry Xmas to those on this foruumOlder guy here with some experience but not allot so please be gentle.I am having problems with setting cookies on my web site. At one time they worked and for the
PHP hyperlinks generator - HELP plz
HiI need some help to get this done using php:1 - I have few hyperlinks say 500 in format like:<a href="http://domaina.com/1.html"
help with variable
I've got a problem, i want to echo some images depending on the $id, however for me to get that id i have to extract it from a query. So i've done that, but i want to extract all id's (not just 1), so
Blogging s/w
heya frndz!!! i want to start a blog.... m looking for a s/w like oscommerce which is thr for e-comm websites... so can u please suggest me some s/w through which i can set up the blog... thnx in
Print 'a' to 'z' via for loop
A very simple problem..How Can I print a to z NOT a to y ?It is a part of a code where | $alpha= 'a';for($alpha='a';$alpha!='z';$alpha++){echo $alpha.' ';} Output: a b c d e f g h i j k l m n o p q
Putting double spaces instead of single spaces
Im looking at trying to replace all single spacing between fields with double spacingAt present my file looks like this 3 Caxxxan Maxxxet Waxxxxe Axxxxxxy Co.Kildare but after the double spacing, I
Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there is a way to track uploading with APC and php 5.2 + ?? any suggestions thanks
Add code to enable passing of checkbox variable on login
Ok, I have a login page, but want to add a checkbox that when checked and successful login is made it passes the checkbox value (checked = "Yes" to the next page) which then loads password
cstdatomic (c++0x std::atomic) / g++ 4.4
Hello,