![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 32 Pomógł: 0 Dołączył: 26.05.2012 Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 476 Pomógł: 96 Dołączył: 10.04.2008 Skąd: Koszalin Ostrzeżenie: (0%) ![]() ![]() |
Pobierz źródło strony po przez file_get_contents lub jeżeli wykonujesz na owej stronie jakieś operacje curlem. Następnie wartość pola tekstowego za pomocą wyrażenia regularnego lub za pomocą:
http://simplehtmldom.sourceforge.net/ |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 1 933 Pomógł: 460 Dołączył: 2.04.2010 Skąd: Lublin Ostrzeżenie: (0%) ![]() ![]() |
W zależności od budowy strony. Jeśli jest zbudowana zgodnie ze standardem XML-owym to możesz użyć PHP-owego XML parsera. Jeśli się tutaj nie sprawdzi to zbuduj odpowiednie wyrażenie regularne. Coś w stylu:
Oczywiście to tylko przykład, bo wyrażenie będzie znacznie bardziej rozbudowane. |
|
|
![]()
Post
#4
|
|
Grupa: Zarejestrowani Postów: 32 Pomógł: 0 Dołączył: 26.05.2012 Ostrzeżenie: (0%) ![]() ![]() |
Fragment kodu:
echo $page wyświetla tak jak należy stronę, a file_get_html zwraca następujący błąd: Cytat Warning: file_get_contents() [function.file-get-contents]: open_basedir restriction in effect. File(HTTP/1.1 200 OK Date: Mon, 17 Jun 2013 19:01:07 GMT Server: Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 X-Powered-By: PHP/5.3.25 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Transfer-Encoding: chunked Content-Type: text/html; charset=utf-8 <html style="overflow:scroll;"> <head> <STYLE type="text/css"> a:link { font-weight:bold; color: #804000; text-decoration:none; } a:visited { font-weight:bold; color: #804000; text-decoration:none; } a:active { font-weight:bold; color: #0082BE; text-decoration:none; } a:hover { font-weight:bold; color: #0082BE; text-decoration:none; } </STYLE> </head> in /public_html/simple_html_dom.php on line 75 Warning: file_get_contents(HTTP/1.1 200 OK Date: Mon, 17 Jun 2013 19:01:07 GMT Server: Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 X-Powered-By: PHP/5.3.25 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Transfer-Encoding: chunked Content-Type: text/html; charset=utf-8 <html style="overflow:scroll;"> <head> <STYLE type="text/css"> a:link { font-weight:bold; color: #804000; text-decoration:none; } a:visited { font-weight:bold; color: #804000; text-decoration:none; } a:active { font-weight:bold; color: #0082BE; text-decoration:none; } a:hover { font-weight:bold; color: #0082BE; text-decoration:none; } </STYLE> </head> <style type="text/css"> .hidden { display: none; } .unhidden { display: block; } </style in /public_html/simple_html_dom.php on line 75 Co jest grane? (IMG:style_emoticons/default/wink.gif) Jak wpiszę sztywny link do tej funkcji - też wszystko śmiga, ale strona ta wymaga autoryzacji, dlatego nie mogę wpisać sztywnego linku. Ten post edytował AdBlock 17.06.2013, 20:04:33 |
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 486 Pomógł: 101 Dołączył: 27.06.2010 Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 23.08.2025 - 19:30 |