
Gabriel10101
Membros-
Total de itens
37 -
Registro em
-
Última visita
Tudo que Gabriel10101 postou
-
Então Jhonas,eu to usando a fuction para procurar pela class,porém não estou conseguindo usar ela,pode me ajudar? function GetElementById(const Doc: IDispatch; const Id: string): IDispatch; var Document: IHTMLDocument2; // IHTMLDocument2 interface of Doc Body: IHTMLElement2; // document body element Tags: IHTMLElementCollection; // all tags in document body Tag: IHTMLElement; // a tag in document body I: Integer; // loops thru tags in document body begin Result := nil; // Check for valid document: require IHTMLDocument2 interface to it if not Supports(Doc, IHTMLDocument2, Document) then raise Exception.Create('Invalid HTML document'); // Check for valid body element: require IHTMLElement2 interface to it if not Supports(Document.body, IHTMLElement2, Body) then raise Exception.Create('Can''t find <body> element'); // Get all tags in body element ('*' => any tag name) Tags := Body.getElementsByTagName('*'); // Scan through all tags in body for I := 0 to Pred(Tags.length) do begin // Get reference to a tag Tag := Tags.item(I, EmptyParam) as IHTMLElement; // Check tag's id and return it if id matches if AnsiSameText(Tag.ClassName, Id) then begin Result := Tag; Break; end; end; end; Não consigo fazer o programa procurar pela class: "mail required email" e colocar um value nela.
-
A ok vou tentar aqui,outra dúvida como posso fazer para preencher um campo que sempre gera um id diferente? <input id="66c52590-5f06-4e30-9fdd-ed0b28ee7187.loginForm.username" maxlength="50" name="66c52590-5f06-4e30-9fdd-ed0b28ee7187:username" value="" tabindex="1" class="mail required email" type="text" crmwa_forminfo="e-mail|">
-
Não,da o seguinte erro: Method 'InnerHTML' not supported by automation object.
-
Jhonas,muito obrigado cara,não sei como te agradecer,esse último deu certo,você é demais cara !!! @Aproveitando o tópico,como pesso pegar o total de "gold": <div class="moduleBox MainForm" style="margin-top: 15px;"> <div class="moduleBox"> <fieldset> <legend> Resumo da Conta </legend> <div class="content"> <div style='padding: 10px 5px; font-size: 16px; color: #444;'> Saldo Atual: <strong>Gold: 0</strong> </div> </div> </fieldset> </div> </div> Eu queria pegar o "0" depois do "GOLD:" Tentei assim: showmessage(WebBrowser1.OleObject.Document.All.Tags('div').InnerHTML); Pode me ajudar com isso também? Obrigado novamente.
-
Então consegui usar o código,mas ainda está pegando o captcha,existe alguma outra maneira? Eu fiz um teste manualmente,eu tentei até aparecer o captcha então limpei os cookies e deu certo,no programa como falei é so abrindo e fechando,tem alguma outra sugestão?
-
Esse codigo que você me mandou da os seguintes erros: [Error] Unit1.pas(64): Local class, interface or object types not allowed [Error] Unit1.pas(73): Local class, interface or object types not allowed [Error] Unit1.pas(78): Undeclared identifier: 'TIID' [Error] Unit1.pas(82): Local class, interface or object types not allowed [Error] Unit1.pas(90): ';' expected but 'IMPLEMENTATION' found [Error] Unit1.pas(25): Unsatisfied forward or external declaration: 'TForm1.FormCreate' [Error] Unit1.pas(26): Unsatisfied forward or external declaration: 'TForm1.OnDocumentComplete' [Error] Unit1.pas(27): Unsatisfied forward or external declaration: 'TForm1.Button5Click' [Error] Unit1.pas(28): Unsatisfied forward or external declaration: 'TForm1.Button2Click' [Error] Unit1.pas(29): Unsatisfied forward or external declaration: 'TForm1.btnAbrirClick' [Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas' Linha: IEnumSTATURL = interface(IUnknown) Parte maior do code unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, OleCtrls, SHDocVw, StdCtrls, ExtCtrls, Menus, Buttons, StrUtils, ShellApi, XPMan, WinInet, ComObj, ActiveX; type TForm1 = class(TForm) Panel1: TPanel; Button5: TButton; WebBrowser1: TWebBrowser; Memo1: TMemo; Memo2: TMemo; Button2: TButton; Memo3: TMemo; btnAbrir: TButton; dialogAbrir: TOpenDialog; XPManifest1: TXPManifest; edtAbrir: TEdit; procedure FormCreate(Sender: TObject); procedure OnDocumentComplete(Sender: TObject;const pDisp: IDispatch;var URL: OleVariant); procedure Button5Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure btnAbrirClick(Sender: TObject); private { Private declarations } public { Public declarations } Continuar: Boolean; logo: Boolean; end; var Form1: TForm1; N, P, Q, tel, Mes, Erro: String; D,A,total,k, Res: Integer; implementation {$R *.dfm} procedure ClearInternetExplorerHistory; const CLSID_CUrlHistory: TGUID = '{3C374A40-BAE4-11CF-BF7D-00AA006946EE}'; type TSTATURL = record cbSize: DWORD; pwcsUrl: DWORD; pwcsTitle: DWORD; ftLastVisited: FILETIME; ftLastUpdated: FILETIME; ftExpires: FILETIME; dwFlags: DWORD; end; IEnumSTATURL = interface(IUnknown) ['{3C374A42-BAE4-11CF-BF7D-00AA006946EE}'] function Next(celt: Integer; out elt; pceltFetched: PLongint): HRESULT; stdcall; function Skip(celt: Longint): HRESULT; stdcall; function Reset: HResult; stdcall; function Clone(out ppenum: IEnumSTATURL): HResult; stdcall; function SetFilter(poszFilter: PWideChar; dwFlags: DWORD): HResult; stdcall; end; Atualmente para burlar o captcha tenho que fechar e abrir o programa.
-
Então já tinha tentado esse,porém não funciona no meu caso,porque eu preciso limpar os cookies para evitar que apareça um captcha.
-
Olá estou usando webbrowser,e quero limprar os cookies do navegador em certa parte do código,mas não estou conseguindo,depois de muita procura achei um código mais não consegui usa-lo: procedure DeleteCache(ACache, ACookies, AHistory:boolean); var lpEntryInfo: PInternetCacheEntryInfo; hCacheDir: LongWord; dwEntrySize: LongWord; begin if (not ACache) and (not ACookies) and (not AHistory) then// nothing to delete exit; dwEntrySize := 0; FindFirstUrlCacheEntry(nil, TInternetCacheEntryInfo(nil^), dwEntrySize); GetMem(lpEntryInfo, dwEntrySize); if dwEntrySize > 0 then lpEntryInfo^.dwStructSize := dwEntrySize; hCacheDir := FindFirstUrlCacheEntry(nil, lpEntryInfo^, dwEntrySize); if hCacheDir <> 0 then begin repeat // delete cookies if (ACookies and ((lpEntryInfo^.CacheEntryType and COOKIE_CACHE_ENTRY) = COOKIE_CACHE_ENTRY)) // delete history or (AHistory and ((lpEntryInfo^.CacheEntryType and URLHISTORY_CACHE_ENTRY) = URLHISTORY_CACHE_ENTRY)) // delete "normal" cache or (ACache and ((lpEntryInfo^.CacheEntryType and NORMAL_CACHE_ENTRY) = NORMAL_CACHE_ENTRY)) then DeleteUrlCacheEntry(lpEntryInfo^.lpszSourceUrlName); FreeMem(lpEntryInfo, dwEntrySize); dwEntrySize := 0; FindNextUrlCacheEntry(hCacheDir, TInternetCacheEntryInfo(nil^), dwEntrySize); GetMem(lpEntryInfo, dwEntrySize); if dwEntrySize > 0 then lpEntryInfo^.dwStructSize := dwEntrySize; until not FindNextUrlCacheEntry(hCacheDir, lpEntryInfo^, dwEntrySize); end; FreeMem(lpEntryInfo, dwEntrySize); FindCloseUrlCache(hCacheDir); end; Tentei: DeleteCache(ACookies); DeleteCache; Se alguém poder me ajudar,fico grato. (Uso delphi 7)
-
Tentei e não deu certo,quando aperto o botão salvar não acontece nada :/
-
Estou criando um botão para salvar tudo que está dentro de um memo no formato .txt,mas quando clico no botão não acontece nada. procedure TForm1.btnsalvarClick(Sender: TObject); begin SaveDialog1.Execute; if SaveDialog1.FileName <> '' then Memo2.Lines.SaveToFile(SaveDialog1.FileName +'.txt'); end;
-
Nâo da porque precisa estar logado,ele vai mandar para pagina de login
-
Olá,estou tentando puxar os dados de um html para o delphi usando webbrowser,porque quero exibir no delphi,mas não consigo. HTML: <li> <dt> <dl> <strong>User:</strong> <small>( <i class="icon novo"></i> Bem Vindo )</small> </dt> <dd> <strong id="accountEscrow" class="color grey">0</strong> </dd> <dd> <strong id="accountBlocked" class="color grey">0</strong> </dd> </dl> </li> Eu precisava dos account: Escrow,Blocked