Helpme with this url
Moderator: General Moderators
Helpme with this url
I want to extract the tables in this url:
http://www.mercadodeliniers.com.ar/dll/ ... R&CP=57201
but i can't.
Need to extract the data in an array to parse it with webcell (http://www.ravis.org/)
Thanks.
http://www.mercadodeliniers.com.ar/dll/ ... R&CP=57201
but i can't.
Need to extract the data in an array to parse it with webcell (http://www.ravis.org/)
Thanks.
Code: Select all
$q=implode("",file("http://www.mercadodeliniers.com.ar/dll/agricultura1.dll/agrimerc000008?ID=&CP=65421&USUARIO=SIN%20IDENTIFICAR&LISTADO=NO"));
preg_match_all("|<TR VAlign="Bottom" BgColor="#E8EABD">.*</TR>|",$q,$matches);
foreach($matches[0] as $match){
$match=preg_replace("|</?TR[^>]*>|","",$match);
preg_match_all("|<TD[^>]*><span[^>]*>(.*)</span></TD>|U",$match,$field_matches,PREG_PATTERN_ORDER);
$first_table[]=$field_matches[1];
}
print_r($first_table);don't work
dosn't work i get a blank page, i don't now what i can do now!
Please helpme.
Please helpme.
It works pretty well for me, giving something like:
try it from the command line
Code: Select all
Array
(
ї0] => Array
(
)
ї1] => Array
(
ї0] => <BR>NOVILLOS Mest.EyB 401/420
ї1] => 1,980
ї2] => 2,082
ї3] => 2,032
ї4] => 2,030
ї5] => 170
ї6] => 1,970
ї7] => 2,040
ї8] => sost.
ї9] => 0,03
ї10] => <img src="/agricultura/suba.gif" width="6" height="8">
)
ї2] => Array
(
ї0] => NOVILLOS Mest.EyB 421/440
ї1] => 1,965
ї2] => 2,048
ї3] => 2,011
ї4] => 2,005
ї5] => 307
ї6] => 1,960
ї7] => 2,030
ї8] => sost.
ї9] => 0,03
ї10] => <img src="/agricultura/suba.gif" width="6" height="8">
)
........................................................
ї22] => Array
(
ї0] => TOROS Regulares
ї1] => 1,150
ї2] => 1,508
ї3] => 1,426
ї4] => 1,450
ї5] => 153
ї6] => 1,080
ї7] => 1,530
ї8] => encal.
ї9] => =
ї10] =>
)
)Please visit my site
http://www.bassoenlared.com.ar/test/connect.php i dont now what you do, but i can't.
how in command line, can i with putty by ssh?
I have a paid server
thanks
how in command line, can i with putty by ssh?
I have a paid server
thanks
Re: Please visit my site
ssh to your server, cd to directory where the script is located and then type:dumbo wrote:how in command line, can i with putty by ssh?
php connect.php
it should run the script from command line (on your server, of course).
this is my code
i receive only a few data. if you want try
http://www.bassoenlared.com.ar/test/connect.php it show $q
and an error
Notice: Undefined variable: first_table in /www/docs/bassoenlared.com.ar/public_html/test/connect.php on line 12 (where print_r....)
<?
error_reporting (E_ALL);
$q=implode("",file("http://www.mercadodeliniers.com.ar/dll/ ... LISTADO=NO"));
echo $q;
preg_match_all("|<TR VAlign=\"Bottom\" BgColor=\"#E8EABD\">.*</TR>|",$q,$matches);
foreach($matches[0] as $match){
$match=preg_replace("|</?TR[^>]*>|","",$match);
preg_match_all("|<TD[^>]*><span[^>]*>(.*)</span></TD>|U",$match,$field_matches,PREG_PATTERN_ORDER);
$first_table[]=$field_matches[1];
}
print_r($first_table);
?>
http://www.bassoenlared.com.ar/test/connect.php it show $q
and an error
Notice: Undefined variable: first_table in /www/docs/bassoenlared.com.ar/public_html/test/connect.php on line 12 (where print_r....)
<?
error_reporting (E_ALL);
$q=implode("",file("http://www.mercadodeliniers.com.ar/dll/ ... LISTADO=NO"));
echo $q;
preg_match_all("|<TR VAlign=\"Bottom\" BgColor=\"#E8EABD\">.*</TR>|",$q,$matches);
foreach($matches[0] as $match){
$match=preg_replace("|</?TR[^>]*>|","",$match);
preg_match_all("|<TD[^>]*><span[^>]*>(.*)</span></TD>|U",$match,$field_matches,PREG_PATTERN_ORDER);
$first_table[]=$field_matches[1];
}
print_r($first_table);
?>
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
what does this return:
If this returns nothing then obviously you can't use url in file functions.
Otherwise try the following:
If this doesn't work - then something is wrong with the url (although it works for me).
Code: Select all
<?php
error_reporting (E_ALL);
$q=implode("",file("http://www.google.com/"));
echo $q;
?>Otherwise try the following:
Code: Select all
<?php
error_reporting (E_ALL);
$q=implode("",file("http://www.mercadodeliniers.com.ar/dll/agricultura1.dll/agrimerc000008?ID=&CP=65421&USUARIO=SIN%20IDENTIFICAR&LISTADO=NO"));
echo $q;
?>