• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Kullanıcı Adı ve şifreli web sayfasına girememe sorunu

  • Konbuyu başlatan Konbuyu başlatan kozmo
  • Başlangıç tarihi Başlangıç tarihi
Katılım
24 Aralık 2010
Mesajlar
24
Excel Vers. ve Dili
Microsoft® Excel® LTSC MSO (16.0.14332.20541) 32 bit Standart 2021
Merhaba,

Aşağıdaki web sayfasında kullanıcı adı,şifre ve kimdlik doğrulama alanlarını girmeye çalışıyorum ancak beceremedim, kod bilgim aşağıdaki gibi nerede hata yapıyorum yardımcı oalabilirmisiniz.
http://10.108.10.55:8080/BOE/BI

Kod:
Private Sub CommandButton1_Click()

On Error Resume Next

Dim objIE As InternetExplorer
Dim HTMLdoc As MSHTML.HTMLDocument
Dim htmlInput As MSHTML.HTMLInputElement
Dim htmlColl As MSHTML.IHTMLElementCollection

sat = ActiveWindow.RangeSelection.Row
If Sayfa1.Cells(sat, "d") = "" Then
MsgBox "hatali satir sectiniz.."
Exit Sub
End If

Set objIE = New InternetExplorerMedium
objIE.navigate "http://10.108.10.55:8080/BOE/BI/" 'url

objIE.Visible = 1

Do While objIE.readyState <> READYSTATE_COMPLETE: DoEvents: Loop

Set HTMLdoc = objIE.document

HTMLdoc.getElementById("_id0:logon:AUTH_TYPE").Value = Sayfa1.Cells(sat, "f") 'SAP
HTMLdoc.getElementById("_id0:logon:USERNAME").Value = Sayfa1.Cells(sat, "d") 'Kullanıcı Adı
HTMLdoc.getElementById("_id0:logon:PASSWORD").Value = Sayfa1.Cells(sat, "e") 'şifre


    Set htmlColl = HTMLdoc.getElementsByTagName("input")
    Set a = HTMLdoc.getElementsByClassName("_id0:logon:logonButton")
    
    For Each htmlInput In a
        If Trim(htmlInput.Type) = "submit" Then
            htmlInput.Click 'giriş butonuna tıklandı
            Exit For
        End If
    Next htmlInput
    
End Sub
 
Merhaba , verdiğiniz "Url" ye giriş yapamadım , hata aldığınız satır hangisi ?
 
Form kodu aşağıdaki gibi; id kısımları id="_id0:logon:USERNAME" ve id="_id0:logon:PASSWORD" giriş butonuda id="_id0:logon:logonButton" şeklinde görünüyor, bilgilerini girmeyi başardım ancak giriş butonuna bastıramadım.


Kod:
<form id="_id0" method="post" action="logon.faces" enctype="application/x-www-form-urlencoded" onsubmit="return onSubmitLogon();" autocomplete="off">

            <script type="text/javascript">document.getElementById("_id0").action = "logon.faces";</script><div class="logonComponent">
<div class="logonInstruction">
<div class="logonFirstInstruction">
Kullanıcı bilgilerinizi girip "Oturum Aç"ı tıklayın.
</div>
<div class="logonSecondInstruction">
Hesap bilgilerinizden emin değilseniz sistem yöneticinizle irtibata geçin.
</div>
</div>

<div class="logonFields logon_table">
<div class="logonRow" id="_id0:logon:CMS:row">
<div class="logonLabel">
<label for="_id0:logon:CMS">Sistem:</label>
</div>
<div class="logonInput">
<input type="text" id="_id0:logon:CMS" name="_id0:logon:CMS" value="VESHNABO:6400">
</div>

</div>
<div class="logonRow" id="_id0:logon:SAP_SYSTEM:row" style="display: block;">
<div class="logonLabel">
<label for="_id0:logon:SAP_SYSTEM">SAP Sistemi:</label>
</div>
<div class="logonInput logonSAP">
<input type="text" id="_id0:logon:SAP_SYSTEM" name="_id0:logon:SAP_SYSTEM" size="3" maxlength="3">
</div>

</div>
<div class="logonRow" id="_id0:logon:SAP_CLIENT:row" style="display: block;">
<div class="logonLabel">
<label for="_id0:logon:SAP_CLIENT">SAP İstemcisi:</label>
</div>
<div class="logonInput logonSAP">
<input type="text" id="_id0:logon:SAP_CLIENT" name="_id0:logon:SAP_CLIENT" size="3" maxlength="3">
</div>

</div>
<div class="logonRow" id="_id0:logon:USERNAME:row">
<div class="logonLabel">
<label for="_id0:logon:USERNAME">Kullanıcı Adı:</label>
</div>
<div class="logonInput">
<input type="text" id="_id0:logon:USERNAME" name="_id0:logon:USERNAME" value="SELCUKBU" maxlength="12">
</div>

</div>
<div class="logonRow" id="_id0:logon:PASSWORD:row">
<div class="logonLabel">
<label for="_id0:logon:PASSWORD">Parola:</label>
</div>
<div class="logonInput">
<input type="password" id="_id0:logon:PASSWORD" name="_id0:logon:PASSWORD">
</div>

</div>
<div class="logonRow" id="_id0:logon:AUTH_TYPE:row">
<script type="text/javascript">
function onAuthTypeChange(authSelect) {
var sapSystem = document.getElementById("_id0:logon:SAP_SYSTEM:row");
var sapClient = document.getElementById("_id0:logon:SAP_CLIENT:row");

sapSystem.style.display = "none";
sapClient.style.display = "none";
if (!authSelect) {
return;
}

var authType = authSelect.options[authSelect.selectedIndex];

var usernameInput = document.getElementById("_id0:logon:USERNAME");
if (authType.value == "secSAPR3" && sapSystem && sapClient) {
if (usernameInput) {
if (usernameInput.value.length > 12) {
usernameInput.value = "";
}

usernameInput.maxLength = 12;
}

if (true) {
sapSystem.style.display = "block";
sapClient.style.display = "block";
}
} else if (sapSystem && sapClient) {
if (usernameInput) {
usernameInput.removeAttribute("maxLength");
}

}
}
</script>
<div class="logonLabel">
<label for="_id0:logon:AUTH_TYPE">Kimlik Doğrulaması:</label>
</div>
<div class="logonInput">
<select id="_id0:logon:AUTH_TYPE" name="_id0:logon:AUTH_TYPE" onchange="onAuthTypeChange(this);">
<option value="secEnterprise">Enterprise</option>
<option value="secLDAP">LDAP</option>
<option value="secWinAD">Windows AD</option>
<option selected="selected" value="secSAPR3">SAP</option>
<option value="secOraApps">Oracle EBS</option>
<option value="secPSE1">JD Edwards EnterpriseOne</option>
<option value="secpsenterprise">PeopleSoft Enterprise</option>
<option value="secSiebel7">Siebel7</option>
</select>
</div>
<script type="text/javascript">onAuthTypeChange(document.getElementById("_id0:logon:AUTH_TYPE"));</script>
</div>
</div>

<div class="logonButton">
<input type="submit" id="_id0:logon:logonButton" value="Oturum Aç" class="logonButtonNoHover logon_button_no_hover" onmouseover="this.className = 'logonButtonHover logon_button_hover';" onmouseout="this.className = 'logonButtonNoHover logon_button_no_hover';">
</div>

</div>


        <input type="hidden" name="com.sun.faces.VIEW" id="com.sun.faces.VIEW" value="_id20189:_id20190"><input type="hidden" name="_id0" value="_id0">
<script type="text/javascript">
<!--
function clearFormHiddenParams__id0(curFormName) {
  var curForm = document.forms[curFormName];
}
//-->
</script>
</form>
 
Merhaba , aşağıdaki gibi deneyin..

Kod:
HTMLdoc.getElementById("_id0:logon:logonButton").Click
 
Nereye eklediniz de olmadı , hata mı verdi , biraz daha bilgi vermelisiniz , sadece "olmadı" dediğinizde çözüme ulaşmamız zor..
 
Aşağıdaki gibi yaptım çalıştığım yerde sistemler çok olduğundan hepsinin şifresi farklı kullanıcı adı şifresi ve butona basmıyor, diğer linklerimde çalışma yaptım bunda yapamadım. web sayfası local olduğundan dışardan giriş yapılamıyor.Sitenin bütün kaynağınıda paylaşabilirim.

Kod:
Sub dashboard()


On Error Resume Next

Dim objIE As InternetExplorer
Dim HTMLdoc As MSHTML.HTMLDocument
Dim htmlInput As MSHTML.HTMLInputElement
Dim htmlColl As MSHTML.IHTMLElementCollection

sat = ActiveWindow.RangeSelection.Row
If Sayfa1.Cells(8, "d") = "" Then
MsgBox "Kullanıcı Adı Giriniz."
Exit Sub
End If

If Sayfa1.Cells(8, "e") = "" Then
MsgBox "Şifre Giriniz."
Exit Sub
End If

Set objIE = New InternetExplorerMedium
objIE.navigate Sayfa1.Cells(8, "c") 'url

objIE.Visible = 1

Do While objIE.readyState <> READYSTATE_COMPLETE: DoEvents: Loop

Set HTMLdoc = objIE.document

HTMLdoc.getElementById("_id0:logon:USERNAME").Value = Sayfa1.Cells(8, "d") 'Kullanıcı Adı
HTMLdoc.getElementById("_id0:logon:PASSWORD").Value = Sayfa1.Cells(8, "e") 'şifre


HTMLdoc.getElementById("_id0:logon:logonButton").Click

End Sub
 
#3 nolu mesajda bilgileri girmeyi başardığınızı sadece giriş butonunda sorun yaşadığınızı söylemiştiniz , son mesajınızda ise bunların hiçbirini yapamadığınızı söylüyorsunuz , kullanıcı bilgilerini girebildiğiniz kodları "url" görünür şekilde paylaşırmısınız.
 
Ben bu link üzerinde girdiğimi sanmıştım aynı excel içinde diğer link için giriş yapabilmişim bu link üzerinde bilgileride yazdıramadım.

Kullanıcı adı kısmını denetle dediğimde aşağıdaki gibi id kısmı başka yerlerdede geçtiğinden yazmıyor diye düşünüyorum,input name olarak getirtebilirsem olur gibi HTMLdoc.getElementByTagname olarakta denedim olmadı.

Kod:
<div class="logonInput">
<input name="_id0:logon:USERNAME" id="_id0:logon:USERNAME" type="text">
</div>

Kod:
HTMLdoc.getElementById("_id0:logon:USERNAME").Value = Sayfa1.Cells(8, "d") 'Kullanıcı Adı

#3 nolu mesajda bilgileri girmeyi başardığınızı sadece giriş butonunda sorun yaşadığınızı söylemiştiniz , son mesajınızda ise bunların hiçbirini yapamadığınızı söylüyorsunuz , kullanıcı bilgilerini girebildiğiniz kodları "url" görünür şekilde paylaşırmısınız.
 
Link nedir yazabilirmisiniz ?
Ve bu link'in kaynak kodlarını.
 
Son düzenleme:
Local adres olduğundan dışardan giriş yapılamıyor. kodların tamamı aşağıdaki gibi

Kod:
<html><head><meta http-equiv="X-UA-Compatible" content="IE=edge,requiresActiveX=true"><script type="text/javascript"></script>
<title>BI başlatma alanı</title><link rel="shortcut icon" type="image/x-icon" href="http://10.108.10.55:8080/BOE/portal/2012261003/InfoView/./images/InfoView.ico"></head><body style="overflow: hidden;" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0"><div data-v-32478853="" class="odm_extension image_downloader_wrapper"><!----></div><form action="../portal/2012261003/InfoView/logon.faces" method="post" target="servletBridgeIframe" style="display:none;">
</form>
<iframe name="servletBridgeIframe" style="position: absolute; min-width: 100%; min-height: 100%; overflow-y: hidden; border:0;" frameborder="0"></iframe><script type="text/javascript">document.forms[0].submit();</script>
<object id="__symantecMPKIClientMessenger" data-supports-flavor-configuration="true" data-extension-version="1.0.0.143" style="display: none;"></object><span id="__symantecMPKIClientDetector" style="display: none;">__PRESENT</span></body></html>
<html dir="ltr" style="display: block;"><head>
<link rel="SHORTCUT ICON" href="./images/InfoView.ico">
<link rel="stylesheet" type="text/css" href="../InfoView/common/appService.do?service=skinning&amp;resource=stylesheet&amp;dir=ltr">


<title>BI başlatma alanı</title>

<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="../shared/js/caf/helpSystem.js"></script>
<script type="text/javascript" src="../InfoView/help/tr/html/HelpFileMap.js"></script>
<script type="text/javascript">

try{
    window.parent.document.title = 'BI başlatma alanı';

    var iconlink = window.parent.document.createElement("link");
    iconlink.setAttribute("rel", "shortcut icon");
    iconlink.setAttribute("type", "image/x-icon");
    iconlink.setAttribute("href", window.location.href.substring(0, window.location.href.lastIndexOf('/')) + "/" + "./images/InfoView.ico");
    window.parent.document.getElementsByTagName("head")[0].appendChild(iconlink);
}catch (e) {}

var rpContext = "..";
// initialize help page

var help_locale = 'tr';
var logonHelpUrl = '/InfoView/help/%LOC%/html/default.htm?' + window['id6989'];
var helpSystem = new HelpSystem('infoViewHelpWindow', 'DEFAULT', logonHelpUrl, rpContext, help_locale);
        
function onBtnHelpClick()
{
        helpSystem.showHelp ();
}

function addAutocomplete(){
    document.getElementsByTagName("form")[0].setAttribute("autocomplete", "off");
}

</script>
</head>
<body onload="addAutocomplete()">


     <style type="text/css">
         html { display: none; }
     </style>
     <script type="text/javascript">
     if (parent == top) {
         document.documentElement.style.display = 'block';
     } else {
         if (true) {
             top.location = parent.location;
         } else {
             // append warning message so that user gets to see it
             var query = parent.location.search;
             query += (query.indexOf("?") < 0) ? "?" : "&";
             query += "warningMessage=";
             // note: it's this verbose since we can't assign parent.location to a variable without IE blowing up
             top.location = parent.location.protocol + '//' + parent.location.host + parent.location.pathname + query;
         }
     }
     </script>





    <div class="logonContainer">
        <div class="logonBanner"></div>
        <div class="logonProductDescription">
            <div class="logonProductName">SAP BusinessObjects</div>
            <div class="logonSubTitle">BI başlatma alanı</div>
        </div>

        <script>
            var logonSubmitted = false;
            function onSubmitLogon() {
                if (!logonSubmitted) {
                    logonSubmitted = true;
                    return true;
                }
                // stop event to prevent multiple logon
                return false;
            }
        </script>
        <form id="_id0" method="post" action="logon.faces" enctype="application/x-www-form-urlencoded" onsubmit="return onSubmitLogon();" autocomplete="off">

            <script type="text/javascript">document.getElementById("_id0").action = "logon.faces";</script><div class="logonComponent">
<div class="logonInstruction">
<div class="logonFirstInstruction">
Kullanıcı bilgilerinizi girip "Oturum Aç"ı tıklayın.
</div>
<div class="logonSecondInstruction">
Hesap bilgilerinizden emin değilseniz sistem yöneticinizle irtibata geçin.
</div>
</div>

<div class="logonFields logon_table">
<div class="logonRow" id="_id0:logon:CMS:row">
<div class="logonLabel">
<label for="_id0:logon:CMS">Sistem:</label>
</div>
<div class="logonInput">
<input type="text" id="_id0:logon:CMS" name="_id0:logon:CMS" value="VESHNABO:6400">
</div>

</div>
<div class="logonRow" id="_id0:logon:SAP_SYSTEM:row" style="display: block;">
<div class="logonLabel">
<label for="_id0:logon:SAP_SYSTEM">SAP Sistemi:</label>
</div>
<div class="logonInput logonSAP">
<input type="text" id="_id0:logon:SAP_SYSTEM" name="_id0:logon:SAP_SYSTEM" size="3" maxlength="3">
</div>

</div>
<div class="logonRow" id="_id0:logon:SAP_CLIENT:row" style="display: block;">
<div class="logonLabel">
<label for="_id0:logon:SAP_CLIENT">SAP İstemcisi:</label>
</div>
<div class="logonInput logonSAP">
<input type="text" id="_id0:logon:SAP_CLIENT" name="_id0:logon:SAP_CLIENT" size="3" maxlength="3">
</div>

</div>
<div class="logonRow" id="_id0:logon:USERNAME:row">
<div class="logonLabel">
<label for="_id0:logon:USERNAME">Kullanıcı Adı:</label>
</div>
<div class="logonInput">
<input type="text" id="_id0:logon:USERNAME" name="_id0:logon:USERNAME" value="SELCUKBU" maxlength="12">
</div>

</div>
<div class="logonRow" id="_id0:logon:PASSWORD:row">
<div class="logonLabel">
<label for="_id0:logon:PASSWORD">Parola:</label>
</div>
<div class="logonInput">
<input type="password" id="_id0:logon:PASSWORD" name="_id0:logon:PASSWORD">
</div>

</div>
<div class="logonRow" id="_id0:logon:AUTH_TYPE:row">
<script type="text/javascript">
function onAuthTypeChange(authSelect) {
var sapSystem = document.getElementById("_id0:logon:SAP_SYSTEM:row");
var sapClient = document.getElementById("_id0:logon:SAP_CLIENT:row");

sapSystem.style.display = "none";
sapClient.style.display = "none";
if (!authSelect) {
return;
}

var authType = authSelect.options[authSelect.selectedIndex];

var usernameInput = document.getElementById("_id0:logon:USERNAME");
if (authType.value == "secSAPR3" && sapSystem && sapClient) {
if (usernameInput) {
if (usernameInput.value.length > 12) {
usernameInput.value = "";
}

usernameInput.maxLength = 12;
}

if (true) {
sapSystem.style.display = "block";
sapClient.style.display = "block";
}
} else if (sapSystem && sapClient) {
if (usernameInput) {
usernameInput.removeAttribute("maxLength");
}

}
}
</script>
<div class="logonLabel">
<label for="_id0:logon:AUTH_TYPE">Kimlik Doğrulaması:</label>
</div>
<div class="logonInput">
<select id="_id0:logon:AUTH_TYPE" name="_id0:logon:AUTH_TYPE" onchange="onAuthTypeChange(this);">
<option value="secEnterprise">Enterprise</option>
<option value="secLDAP">LDAP</option>
<option value="secWinAD">Windows AD</option>
<option selected="selected" value="secSAPR3">SAP</option>
<option value="secOraApps">Oracle EBS</option>
<option value="secPSE1">JD Edwards EnterpriseOne</option>
<option value="secpsenterprise">PeopleSoft Enterprise</option>
<option value="secSiebel7">Siebel7</option>
</select>
</div>
<script type="text/javascript">onAuthTypeChange(document.getElementById("_id0:logon:AUTH_TYPE"));</script>
</div>
</div>

<div class="logonButton">
<input type="submit" id="_id0:logon:logonButton" value="Oturum Aç" class="logonButtonNoHover logon_button_no_hover" onmouseover="this.className = 'logonButtonHover logon_button_hover';" onmouseout="this.className = 'logonButtonNoHover logon_button_no_hover';">
</div>

</div>


        <input type="hidden" name="com.sun.faces.VIEW" id="com.sun.faces.VIEW" value="_id20795:_id20796"><input type="hidden" name="_id0" value="_id0">
<script type="text/javascript">
<!--
function clearFormHiddenParams__id0(curFormName) {
  var curForm = document.forms[curFormName];
}
//-->
</script>
</form>
        
        <a class="helpLink" href="#Help" id="Help" onclick="onBtnHelpClick(); return false;">
            Yardım
        </a>
        
        <div class="logonBannerLogo" style="background: url(../InfoView/common/appService.do?service=skinning&amp;resource=img&amp;img=img.login.banner.logo); background-repeat: no-repeat;"></div>
        
        
        
    </div>



</body></html>

Link nedir yazabilirmisiniz ?
 
Aşağıdaki kodları denermisiniz , hata olursa adım adım ilerleyerek nerde hata olduğunu gözlemleyin, bakalım.

Kod:
Sub Test()
                
    Set ie = New InternetExplorerMedium
    ie.navigate "http://10.108.10.55:8080/BOE/portal/2012261003/InfoView/logon.faces"

    
    Do Until ie.readyState = 4: DoEvents: Loop: Do While ie.Busy: DoEvents: Loop
    ie.Visible = True
    
    ie.document.getElementById("_id0:logon:USERNAME").Value = "Kullanici_Adi"
    ie.document.getElementById("_id0:logon:PASSWORD").Value = "Sifre"
    ie.document.getElementById("_id0:logon:logonButton").Click
    
    
End Sub
 
web sayfası açılıyor ancak veri girişi click işlemi gerçekleşmiyor.
 
Sayfanın tam yuklenmesi için 1 veya 2 saniye bekleme kodu ekleyerek deneyin birde.

Do Until ie.readyState = 4: DoEvents: Loop: Do While ie.Busy: DoEvents: Loop
ie.Visible = True
Application.Wait Now + TimeValue("00:00:02")
 
Çok teşekkür ederim işe yaradı

Sayfanın tam yuklenmesi için 1 veya 2 saniye bekleme kodu ekleyerek deneyin birde.

Do Until ie.readyState = 4: DoEvents: Loop: Do While ie.Busy: DoEvents: Loop
ie.Visible = True
Application.Wait Now + TimeValue("00:00:02")
 
Geri
Üst