O
O
Orbite2018-10-12 13:26:06
PHP
Orbite, 2018-10-12 13:26:06

How to scrape a website in php?

Good afternoon!
I am trying to get html content from a page using the file_get_contents function. I get content from some sites without any problems, but from some I get an error Warning: file_get_contents failed to open stream: HTTP request failed! . What could be the reason?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex-1917, 2018-10-12
@Orbite

file_get_contents

this code is overgrown with reality and covered with mold.
use curl if you don't want to get banned from the admins of the sites you parse.

V
Vlad Osadchyi, 2018-10-12
@VladOsadchyi

code.mu/books/advanced/php/parsing/worka-s-biblio...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question