Что нового

Код страниц в один документ

alladin

Новичок
Сообщения
4
Репутация
0
Ребят, кто сможет помочь?
Нужно выгрузить с двух и более страниц код в один документ.
То есть, у меня, к примеру есть две заглавные страницы - ya.ru и google.com и необходимо выгрузить с них обеих код в документ (doc.html) и сохранить.
Подскажите, как реализовать?
 

joiner

Модератор
Локальный модератор
Сообщения
3,556
Репутация
628
Код:
Local $html
$yandex = InetRead('http://ya.ru/',1)
$html &= BinaryToString($yandex,4) & @CRLF
$google = InetRead('https://www.google.ru/?gfe_rd=cr&ei=9zIdVPatMIfjwQPgxoG4AQ&gws_rd=ssl',1)
$html &= BinaryToString($google,1)
FileWrite('doc.html',$html)
 

alex33

Скриптер
Сообщения
1,457
Репутация
186
1. IE:
Код:
#include <IE.au3>
;_IELoadWaitTimeout(5000)
Local $oIE, $html, $hFile

$oIE = _IECreate("about:blank")

_IENavigate($oIE, "http://ya.ru/")
$html &= _IEDocReadHTML($oIE)
;$html &= @CRLF

_IENavigate($oIE, "http://google.com/")
$html &= _IEDocReadHTML($oIE)

;_IEQuit($oIE)

$hFile = FileOpen(@ScriptDir & "\doc.html", 2)
FileWrite($hFile, $html)
FileClose($hFile)


2. InetRead:
Код:
Local $html, $hFile

$html &= BinaryToString(InetRead("http://ya.ru/"), 4)
;$html &= @CRLF
$html &= BinaryToString(InetRead("http://google.ru/"), 1)

$hFile = FileOpen(@ScriptDir & "\doc.html", 2)
FileWrite($hFile, $html)
FileClose($hFile)
 
Верх