Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 257

 
gyfto:

Sprinkle holy water on your computer.

I'm serious, I'm not kidding. I want to put the owl in. I can't think straight about the settings now.
 
Glina:

I have two accounts, one is eurodollar 1.3469 and the other is now 1.36690.
I don't understand anything of your problem. Are you switching between different accounts in the same terminal?
 
artmedia70:
I don't understand anything from the essence of your problem. Are you switching between different accounts in the same terminal?


There are two terminals too, but one has switched 4 to 5 digits.
 
gyfto:

mzk_3om6u, DOM structures are easiest to work with in IE10 via VBScript/JScript, you can run wsf scripts via WinExec(). You are trying to convert the tags. What for? You can work in peace via InnerText, at the end of the script you write to a file, in the index you receive the file. Here is an example:


The problem is not in saving data and not even in searching tags, everything is banal and simple, I want in MT4 to search in Cyrillic, but when saving a page from the Internet any Cyrillic is converted to another encoding.
 
mzk_3om6u:

Well, the problem is not in saving data, and not even in the search for tags, everything is trivial and simple, I want in MT4 to search in Cyrillic, but when you save a page from the Internet, any Cyrillic is converted to another encoding.


This weekend I'll try to render your site and see what I can do. Can't do it before then, the terminal is busy.

 
Glina:

There are two terminals too, but one has changed from 4 to 5 digits.
Sorry, but I've lost my sensory faculties.
 
gyfto:


I'll try to unpair your site at the weekend and see what I can do. It won't be possible before then, the terminal is busy.


Nothing interesting there, just MT4 does not see special characters like: no, §, ©, ‰, ×
 
mzk_3om6u:

Nothing interesting there, MT4 just does not see special symbols like: №, §, ©, ‰, ×

I've specially selected only cells with Cyrillic characters - it reads. Take the rest by enumerating j in getElementsByTagName("TD").Item(j), or, more cleverly, select which columns to read in Chromium yourself. Write it as csv, don't forget to concatenate with delimiter, and go for it.

experts/files/trx_rowa.vbs

'On Error Resume Next
Dim IE : Set IE = WSCript.CreateObject("InternetExplorer.Application")' открываем IE
Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")' получаем доступ к FSO
Dim fTxtName : fTxtName = Left(WSCript.ScriptFullName,len(WSCript.ScriptFullName)-3) & "txt"' чтобы писать в csv-файл, поменять txt на csv
Set TxtFile = objFSO.OpenTextFile(fTxtName, 2, True)'открываем файл для записи
IE.visible = false' браузер в фоновом режиме
IE.navigate "http://www.fxteam.ru/forex/economic-calendar/2013_49.html"' страница с календарём для парсинга
Do While IE.Busy' пока браузер не загрузится
        WSCript.Sleep 500' ждём полсекунды
loop' в цикле
Do While IE.document.getElementsByClassName("tr1 rowa").Item(0).getElementsByTagName("TD").Item(4) is Nothing' пока этот элемент страницы не загрузится
        WSCript.Sleep 500' будем ждать загрузки страницы
loop' в цикле
Set tr1_rowa = IE.document.getElementsByClassName("tr1 rowa")' получаем коллекцию таких DOM-элементов
For i = 0 to tr1_rowa.length - 1' перебираем её
        TxtFile.WriteLine tr1_rowa.Item(i).getElementsByTagName("TD").Item(4).InnerText' записываем текстовое содержимое ячейки в файл
Next
Set tr0_rowa = IE.document.getElementsByClassName("tr0 rowa")' получаем коллекцию таких DOM-элементов
For i = 0 to tr0_rowa.length - 1' перебираем её
        TxtFile.WriteLine tr0_rowa.Item(i).getElementsByTagName("TD").Item(4).InnerText' записываем текстовое содержимое ячейки в файл
Next
Set IE = Nothing' закрываем браузер
TxtFile.Close' закрываем файл
WSCript.Quit()' выключаем скрипт

MQL4

#import "kernel32.dll"
   int WinExec(string lpCmdLine, int uCmdShow);
#import
//в старте (или где надо)
WinExec("cscript experts/files/trx_rowa.vbs", 2);
Sleep(60*1000);
hFile = FileOpen("trx_rowa.txt", FILE_READ|FILE_CSV);
while(!FileIsEnding(hFile)){
  //обычный цикл чтения файла...
}
FileClose(hFile);
 
gyfto:

I've specially selected only cells with Cyrillic characters - it reads. Take the rest by enumerating j in getElementsByTagName("TD").Item(j), or, more cleverly, select which columns to read in Chromium yourself. Write as csv, don't forget to concatenate with delimiter, and go.

experts/files/trx_rowa.vbs

MQL4


I still don't understand what to put in where, and how the script is written isn't particularly clear either:(

what is trx_rowa.vbs and what does it have to do with MT4?)

 
mzk_3om6u:


I still don't understand what to put in, and how the script is written is not particularly clear either :(

experts/files/trx_rowa.vbs

It's an evil, unshaven, unknown to science trojan. Devlala, you have googol at a mouse's distance, can't you figure out the source code? Change IE.visible = false to IE.visible = true, run it and see. The script parses your calendar and writes everything in Cyrillic in a text file. Open it and look, it reads fine.