Spok3r Posted July 11, 2019 Share Posted July 11, 2019 Hello everyone, I used this forum quite often and I could get almost everything done with the help of it. It's really amazing. Right now I'm stucked so hard that I thought it might be helpfull, to create an account and to search for a direct suggestion. I just can't make it happen to auto-login into the following site: spreadshirt I'm using it quite often and it's really annoying to login manually. I hope you can send me a solution that solves this specific issue. It looks like that it's a form within an iFrame. I just can't get access to the form within this iFrame. I saw already similar issues but nothing worked out for me. Strange is also that I got several times an error that comes from the IE.au3 itself: C:\Program Files (x86)\AutoIt3\Include\IE.au3" (2295) : ==> The requested action with this object has failed.: $oTemp = $oObject.document.body $oTemp = $oObject^ ERROR Not sure if it has something to do with that, but just to mention it at least once (PS: never changed anything in this IE.au3 file.) If someone could send me the code that makes it possible to auto-login (fill the username/password and to submit everything), it would be just amazing. Tried it already over weeks without success. Thanks in advance. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 11, 2019 Developers Share Posted July 11, 2019 It would help when you actually post the script that's having issues. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Danp2 Posted July 11, 2019 Share Posted July 11, 2019 What ^he said. 😏 P.S. Looks like that section of code is inside the _IEPropertyGet function. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Spok3r Posted July 12, 2019 Author Share Posted July 12, 2019 hmm.. not really sure how _IEPropertyGet could help me there. I get easily access to the normal 2 forms(1.Find Product/ 2.Subscribe letter) on the main site with _IEFrameGetCollection / _IEFormGetCollection & _IEFormElementSetValue. But to be able to login you have an generated iFrame above that whole site after clicking on Login (top-right corner) and the functions doesn't find that iFrame Form. Really curious if anyone can get access and even submit informations into this Login-Form if it's already open. @Jos there is no script because it's just one thing that is not working and it's getting the username/password field filled. If you may have a code that get access /could send a information into this Login-Form , I would really appreciate it. I doubt that it would be more than 3-4 lines but I'm not able to do it. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 12, 2019 Developers Share Posted July 12, 2019 (edited) 1 hour ago, Spok3r said: there is no script because it's just one thing that is not working and it's getting the username/password field filled. mmm. that sounds pretty impossible to me as you have ran into an error running a script...right? I am not good at guessing so maybe others feel the urge to stab in the dark...not me. Jos Edited July 12, 2019 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Spok3r Posted July 12, 2019 Author Share Posted July 12, 2019 1 hour ago, Jos said: mmm. that sounds pretty impossible to me as you have ran into an error running a script...right? I am not good at guessing so maybe others feel the urge to stab in the dark...not me. Jos It's not that I have an error running a script. It's just that I don't have a working script I could show you because I don't have an idea how to do it. I mean if you go to the website you'll see the "form" after clicking on Login. The issue is now to "create" a script that can fill the needed information and get it submited. _IEFrameGetCollection / _IEFormGetCollection is only working for the "forms" that are on the main website (1.Find Product/ 2.Subscribe letter) and not the iFrame login form. Hope it's understandable and clear where the issue is now. I really hope anyone has a solution therefore and could provide it. PS: Did you even look at the website I've linked to understand my issue? Link to comment Share on other sites More sharing options...
Developers Jos Posted July 12, 2019 Developers Share Posted July 12, 2019 Hey listen, You have now typed many sentences and still not posted a script showing the issue ... so wish you success finding your issue. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Danp2 Posted July 12, 2019 Share Posted July 12, 2019 @Spok3r Why should we take the time to review the site when you can't be troubled to provide a simple example script that demonstrates the issue you have encountered? FrancescoDiMuro and Earthshine 2 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Spok3r Posted July 12, 2019 Author Share Posted July 12, 2019 (edited) hmm... no offence but... I'm still confused why my informations are not enough to understand the issue and be able to help. The link to the website is even more usefull in case I'm reading the html-code wrong. With this 2 codes I'm able to get access to the 2 forms on the main website. Local $oIE = _IECreate("https://spreadshirt.com/") Local $oForm = _IEFormGetCollection($oIE, 0) Local $oQuery = _IEFormElementGetCollection($oForm, 0) _IEFormElementSetValue($oQuery, "Product Search") _IEFormSubmit($oForm) Local $oIE = _IECreate("https://spreadshirt.com/") Local $oForm = _IEFormGetCollection($oIE, 1) Local $oQuery = _IEFormElementGetCollection($oForm, 0) _IEFormElementSetValue($oQuery, "Subscribe letter") _IEFormSubmit($oForm) I just don't get the access to the Login-Form with that method I think it will be generated above the main website as in a iFrame?. It just doesn't matter what index I'm using for _IEFormGetCollection to get the access therefore...tried up to 5. Not sure what else I can post so you can try to help me or understand my issue. 🤔 PS: I've tested this method with the login form opened (after clicking on Login) to be sure it's really active. It Edited July 12, 2019 by Spok3r Link to comment Share on other sites More sharing options...
Danp2 Posted July 12, 2019 Share Posted July 12, 2019 14 minutes ago, Spok3r said: I'm still confused why my informations are not enough to understand the issue and be able to help Because you are asking for help on an issue and expecting us to write code for you without you even showing what you have tried thus far. Sorry, but most folks around here don't just regurgitate code unless the OP (you) show some effort P.S. I'll take a look now that you've posted some code. First thought is to use iframe name instead of index number. Spok3r 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted July 12, 2019 Share Posted July 12, 2019 Not sure what your code is demonstrating, but it doesn't seem to involve logging into the website. Here's what I came up with to activate the login form -- #include <ie.au3> Local $lFound = False Local $oIE = _IECreate("https://spreadshirt.com/") Local $oDiv = _IEGetObjById($oIE, "login-menu-header") Local $oDivs = _IETagNameGetCollection($oDiv, "div") For $oDiv In $oDivs If $oDiv.ClassName = "Button" Then $oDiv.click() Sleep(1000) $lFound = True ExitLoop EndIf Next If $lFound Then ; Do login stuff here EndIf Unfortunately, my initial attempts to access this form have been unsuccessful. Not sure, but it may be due to cross domain security restrictions. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Spok3r Posted July 12, 2019 Author Share Posted July 12, 2019 (edited) My problem is exactly the part you've described right now 😅 My code should demostrate the part "; Do login stuff here" To activate the login form I had this code: Local $oIE = _IECreate("https://spreadshirt.com/") $tags = _IETagNameGetCollection($oIE, "div") For $tag in $tags $class_value = $tag.className If $class_value = "Label" Then $sInnerText = _IEPropertyGet($tag,"innertext") $sInnerText = StringStripWS($sInnerText,3) If $sInnerText == "Login" Then _IEAction($tag, "click") EndIf EndIf Next And now.... comes the issue ^^ ; Do login stuff here I just dont get access to this form. Edited July 12, 2019 by Spok3r Link to comment Share on other sites More sharing options...
Danp2 Posted July 12, 2019 Share Posted July 12, 2019 1. That's not the code you posted before. Thanks alot for making me "reinvent the wheel" that you claims to have already solved. 😦 2. Please use code tags when posting code (see FAQ here) 3. You might want to search the forum for any potential solutions dealing with cross-domain frames Earthshine 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Spok3r Posted July 12, 2019 Author Share Posted July 12, 2019 (edited) 1) Sorry didn't intend to "reinvent you the wheel". But I think I've mentioned very clear and often where my issue is, from the beginning. I even mentioned that I had the Login-Form opened, to avoid this. I was just confused that a script was needed to get people ready to help (even if no idea is available how to script it, from my side). Therfore I wanted to line up only the most important part with the code I've shown above. 2) That's a good tipp and I'll try to use it next time, thanks If anyone has a solution or can assits, I really appreciate any help. Cheers! Edited July 12, 2019 by Spok3r Link to comment Share on other sites More sharing options...
Developers Jos Posted July 12, 2019 Developers Share Posted July 12, 2019 9 minutes ago, Spok3r said: But I think I've mentioned very clear and often where my issue is, from the beginning. I even mentioned that I had the Login-Form opened, to avoid this. Yea @Danp2, you dumbass, you need to read better before helping. ( as You noticed, I simply walk away and leave them simmer in their own BS ) Earthshine 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Earthshine Posted July 12, 2019 Share Posted July 12, 2019 (edited) 3 minutes ago, Jos said: Yea @Danp2, you dumbass, you need to read better before helping. ( as You noticed, I simply walk away and leave them simmer in their own BS ) yeah, I need to do what you do more with this type of user.... LOL Edited July 12, 2019 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Danp2 Posted July 12, 2019 Share Posted July 12, 2019 @Jos Thanks for the encouraging words. 🤣 Jos and Earthshine 1 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Earthshine Posted July 12, 2019 Share Posted July 12, 2019 (edited) You are a real trouper @Danp2 And that's a GOOD thing Edited July 12, 2019 by Earthshine Danp2 1 My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Nine Posted July 12, 2019 Share Posted July 12, 2019 @Spok3r Here for you (based on Danp2 hint sometimes ago) : #include <Constants.au3> #include <IE.au3> Local $oIE = _IECreate("https://spreadshirt.com/") Local $tags = _IETagNameGetCollection($oIE, "div") For $tag In $tags $class_value = $tag.className If $class_value = "Label" Then $sInnerText = _IEPropertyGet($tag, "innertext") $sInnerText = StringStripWS($sInnerText, 3) If $sInnerText = "Login" Then _IEAction($tag, "click") ExitLoop EndIf EndIf Next _IELoadWait ($oIE) _IENavigate ($oIE, "https://accounts.spreadshirt.com/login?context=www&lang=en") $oForm = _IEFormGetCollection ($oIE,0) $oItem = _IEFormElementGetObjByName ($oForm, "username") _IEFormElementSetValue ($oItem, "MyUserName") $oItem = _IEFormElementGetObjByName ($oForm, "password") _IEFormElementSetValue ($oItem, "MyPassword") $oItem = _IEFormElementGetObjByName ($oForm, "login-submit") _IEAction($oItem, "click") A hint for you, when you request help and someone asks you to provide something, it is simple politeness to agree... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Earthshine Posted July 12, 2019 Share Posted July 12, 2019 (edited) Nine you softy. Are you Sasha Nine from PSYCHONAUTS? Lol Edited July 12, 2019 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now