Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get Captcha's image from web page
Message
From
14/02/2012 13:08:40
 
 
To
14/02/2012 13:00:08
General information
Forum:
Visual FoxPro
Category:
Internet applications
Environment versions
Application:
Desktop
Miscellaneous
Thread ID:
01535357
Message ID:
01535380
Views:
54
>>Someone had the same problem earlier, thread # 1521872. The solution I gave was to get this image file from the explorer's cache, since it's always stored on disk, and it's usually the most recent image file. Hopefully it has a fixed name, to make it even easier.
>>
>>>Hi guys,
>>>
>>>I am automating a certain process for getting some information from a brazilian government web site.
>>>I would like to get the CAPTCHA image that appears in the page below:
>>>http://www.nfe.fazenda.gov.br/PORTAL/consulta.aspx?tipoConsulta=completa&tipoConteudo=XbSeqxE8pl8=
>>>
>>>How can I do it?
>>>I need only that Captcha image. My goal is to put it in a VFP form, then to ask my user to type the Captcha value, and I will post its contents back to the web page to be able to get some more data, using IE automation,
>>>
>>>Any ideas ?
>>>
>>>Regards,
>>>
>>>Cesar
>
>
>Thanks a lot Tore!
>That's exactly the same question from the old thread. The Captcha, if accessed directly is reloaded. I've tried searching in the Internet cache page, but could not find the image in my computer!

It must be there, but maybe in a hidden folder? Can you see if the image has a fixed name? I have this tool called DirBrow which scans all subdirectories of the directory you select, and let you browse the found files. If you select c:\users\yourname, you should be able to find your image among the most recent ones.
*DirBrow.prg
Clear All
Clear
Public oForm
oForm=Createobject("MyForm",Addbs(Getdir("c:\program files")),"*.exe",.F.)
Define Class MyForm As Form
   AllowOutput=.F.                 && so '?' output goes to screen
   Width=_Screen.Width
   Height=_Screen.Height-50
   Width=1024
   Height=798
   Procedure Init(cPath As String, cMask As String, fSubDir As Boolean)
   Set Exclusive Off
   Set Safety Off
   Set Talk Off
   Set Exact Off
   Create Table Files (Path c(240),fname c(240),Fsize N(10,0),Timestamp T)
   This.DoDir(cPath,cMask)
   Index On Timestamp Descending Tag T   && choose your desired order
*                  INDEX on fsize DESCENDING TAG fsize
   This.AddObject("gr","grid")
   This.gr.AllowCellSelection=.F.
   This.gr.Visible=1
   This.gr.Height=Thisform.Height
   This.gr.Width = Thisform.Width
   This.gr.AutoFit
   This.gr.Column3.InputMask="999,999,999"
   This.Show
   Procedure DoDir(cPath As String, cMask As String)
   Local N,i,aa[1]
   N=Adir(aa,cPath+cMask,"",1)
   For i = 1 To N
      Insert Into Files (Path,fname,Fsize,Timestamp) Values ;
         (cPath, aa[i,1], aa[i,2],Ctot(Dtoc(aa[i,3])+aa[i,4]))
   Endfor
   N=Adir(aa,cPath+"*.*","HD",1)     && now without the mask, search for directories
   For i = 1 To N
      If "D"$aa[i,5] && if it's a dir
         If aa[i,1] != '.'
            This.DoDir(cPath+aa[i,1]+"\",cMask)         && recur
         Endif
      Endif
   Endfor
Enddefine
Previous
Reply
Map
View

Click here to load this message in the networking platform