Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] curl pobraniu paru stron
icetab
post
Post #1





Grupa: Zarejestrowani
Postów: 226
Pomógł: 3
Dołączył: 3.04.2007

Ostrzeżenie: (50%)
XXX--


Jak pobrać kilka stron na raz w jednym skrypcie curl strony by mialy adresy index.php?id=0, index.php?id=15,index.php?id=30,index.php?id=45 itd ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
icetab
post
Post #2





Grupa: Zarejestrowani
Postów: 226
Pomógł: 3
Dołączył: 3.04.2007

Ostrzeżenie: (50%)
XXX--


Zrobiłem tak jak napisałeś ale nie działa w czym problem ? (IMG:style_emoticons/default/smile.gif)

  1. for( $i = 0; $i < $n; $i++ ){
  2. $curl2 = curl_init('http://forumlink.pl/forum/viewtopic.php?t=105&postdays=0&postorder=asc&start='.$i.'');
  3.  
  4. curl_setopt($curl2, CURLOPT_HEADER, 0);
  5. curl_setopt($curl2, CURLOPT_RETURNTRANSFER, true);
  6. curl_setopt($curl2, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12");
  7. curl_setopt($curl2, CURLOPT_COOKIEFILE, "cookie.txt");
  8. curl_setopt($curl2, CURLOPT_COOKIEJAR, "cookie.txt");
  9. $strona = curl_exec($curl2);
  10. echo $strona;
  11. curl_close($curl2);
  12. }
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 11.10.2025 - 21:01