0
I’m trying to get a whole source code from a website.
using CURL I used regular expression
preg_match('/<html>(.*)<\/html>/i', $resultado, $codigo);
echo $codigo = $codigo[1];
but it didn’t work... where is the mistake?
0
I’m trying to get a whole source code from a website.
using CURL I used regular expression
preg_match('/<html>(.*)<\/html>/i', $resultado, $codigo);
echo $codigo = $codigo[1];
but it didn’t work... where is the mistake?
3
Can display the source code of a page with highlight_string()
, this prevents it from being rendered by the browser, so just something like:
highlight_string($resultado);
<CONTENTS> <CONTENTS> <PONTO1> <CONTENTS> <CONTENTS> <PONTO2> <CONTENTS> ?
Browser other questions tagged php regex curl
You are not signed in. Login or sign up in order to post.
Which part you want to take?
– rray
I want to get all the source code. 100% of it
– user7438004
Curl no longer returns this?
– rray
using the code I posted above, the result is: Notice: Undefined offset: 1
– user7438004
The
file_get_contents
wouldn’t be easier/more practical for you?– Florida
verified the content of
$resultado
? see what appears withhighlight_string($resultado);
– rray
@Florida he’s wearing CURL
– Guilherme Nascimento
florida, giving ECHO in file_get_contents, appears the page, and not its code.
– user7438004
The page may appear pq was rendered by the browser, if vc store it in a variable can manipulate the will.
– rray
@rray solved.... thank you very much... using highlight_string($result) appeared the entire page code.... thank you very much
– user7438004