I'm working on angular material layout, it's working fine in all the browsers including IE11, but for smaller screen resolutions, I'm facing content overlapping issue.
Here's the code I've tried:
HTML:
<div layout="row" layout-sm="column" layout-xs="column" layout-wrap>
<div class="innersection" flex="25" flex-sm="100" flex-xs="100" layout="row">
Title <br/><br/> Description:
<br/> Manage your account, username and password setting<br/> Manage your account, username and password setting
</div>
<div class="innersection" flex="25" flex-sm="100" flex-xs="100" layout="row">
Title <br/><br/> Description:
<br/> Manage your account, username and password setting
</div>
<div class="innersection" flex="25" flex-sm="100" flex-xs="100" layout="row">
Title <br/><br/> Description:
<br/> Manage your account, username and password setting<br/> Manage your account, username and password setting
</div>
<div class="innersection" flex="25" flex-sm="100" flex-xs="100" layout="row">
Title <br/><br/> Description:
<br/> Manage your account, username and password setting
</div>
</div>
CSS:
.innersection {
background: #fff; padding:8px; border:1px solid;
}
Here's working fiddle example:
http://jsfiddle.net/xjb0soLn/17/
Appreciate your help.
I found the solution:
http://jsfiddle.net/xjb0soLn/22/
Here's the HTML:
<div layout-gt-sm="row" layout-wrap>
<div class="innersection" flex-gt-sm="25">
Title <br/><br/> Description:
<br/> Manage your account, username and password setting<br/> Manage your account, username and password setting
</div>
<div class="innersection" flex-gt-sm="25">
Title <br/><br/> Description:
<br/> Manage your account, username and password setting
</div>
<div class="innersection" flex-gt-sm="25">
Title <br/><br/> Description:
<br/> Manage your account, username and password setting<br/> Manage your account, username and password setting
</div>
<div class="innersection" flex-gt-sm="25">
Title <br/><br/> Description:
<br/> Manage your account, username and password setting
</div>
</div>
Related
When I try to target the email element by class or id, it will throw an error:
run-time error '438': object doesn't support this property or method
There are no iframes and I can't seem to switch to a window either(that I am seeing).
Here is vba code:
Set bot = New Selenium.ChromeDriver
bot.start baseUrl:="https://app.powerbi.com/singleSignOn"
bot.Get "/"
Application.Wait Now + TimeValue("00:00:3")
Dim FindBy As New Selenium.By
With bot
.FindElementsByCss(".pbi-text-input").Click
.FindElementsById("email").SendKeys ("testing")
end with
Html code:
</head>
<body>
<div id="emailCollection" class="emailBlock" style="display: none;"> <!-- The popup window -->
<div class="emailLogoAndName">
<object type="image/svg+xml" data="13.0.17576.29/images/PowerBI_MasterLogo.svg"></object>
<label>Power BI</label>
</div>
<div class="emailDetailArea">
<div class="emailDetailHeader"><label>Enter your email, we'll check if you need to create a new account.</label></div>
<div class="emailDetailContent">
<div class="emailDetailContentArea">
<div class="emailContentInput">
<div class="emailInputTitle">Email</div>
<div><input class="pbi-text-input" type="text" placeholder="Enter email" id="email"></div>
<div class="emailInputError" style="display: none;"></div>
</div>
<div class="emailContentDisclaimers">
<div class="emailDisclaimer1">
By proceeding you acknowledge that if you use your organization's email, your organization may have rights to access and manage your data and account.
<span class="learnMoreBtn" onmouseover="setPosition(event)">
Learn more about using your organization's email
<span class="learnMoreText">
<b>Using your organization's email address to sign up</b>
<p>If you use an email address provided by an organization you are affiliated with (like an employer or school), the owner of the email domain may (i) manage and administer your account, including modifying and terminating your access and (ii) access and process your data, including the contents of your communications and files. Your directory data (including name, signup date, and email) may be visible to other users of these services within your organization.
</p>
</span>
</span>
</div>
<div class="emailDisclaimer2">
By clicking Submit, you agree to these <a href='https://go.microsoft.com/fwlink/?LinkID=870457&clcid=0x409' target='_blank'>terms and conditions</a> and allow Power BI to get your user and tenant details. <a href='https://go.microsoft.com/fwlink/?LinkID=521839&clcid=0x409' target='_blank'>Microsoft Privacy Statement</a>
</div>
</div>
</div>
<button class="pbi-fluent-button primary" id="submitBtn" onclick="submitEmail()">Submit</button>
</div>
</div>
<div class="emailLogoArea">
<object type="image/svg+xml" data="13.0.17576.29/images/PowerBI_MasterLogo.svg"></object>
</div>
</div>
</body>
</html>
url: https://app.powerbi.com/singleSignOn
As the website is Power BI enabled, 3 seconds may not be enough for the element to be clickable.
You may increase the wait time to 10 secs and you can use either of the following Locator Strategies:
Using FindElementByCss:
bot.FindElementByCss("input.pbi-text-input#email[placeholder='Enter email'][type='text']").SendKeys ("Red")
Using FindElementByXPath:
bot.FindElementByXPath("//input[#class='pbi-text-input' and #id='email'][#placeholder='Enter email' and #type='text']").SendKeys ("Red")
I try to create a simple contact form, but I didn't get any message, the post request is made. I am pretty new with Modx.
What I tried:
Link 1
Link 2
I created 2 Chunks (emailChunkTpl and MyEmailChunk), and in my template I call for the [[$MyEmailChunk]]. Obviously I did something wrong but I am not sure what. The code is like in the examples, but with some changes,like my email.
[[!FormIt?
&hooks=`email,FormItSaveForm `
&emailTpl=`emailChunkTpl`
&emailTo=`myEmail#gmail.com`
&emailUseFieldForSubject=`1`
]]
<form action="[[~[[*id]]]]" method="post" class="contactForm">
<div class="row input-section-child">
<div class="col input-contact">
<input value="[[!+fi.input-name]]"class="input-name" name="input-name" id="input-name" type="text" placeholder="your name" />
<input value="[[!+fi.input-email]]" class="input-email" name="input-email" id="input-email" type="text" placeholder="email address" />
</div>
<div class="col input-contact-text">
<input value="[[!+fi.input-textare]]"class="input-textare" name="input-textare" id="input-textare" type="textare" placeholder="message" />
</div>
</div>
<div class="row second-row">
<div class="col checkbox">
<input value="[[!+fi.input-checkbox]]" class="input-checkbox" name="input-checkbox" id="input-checkbox" type="checkbox" ><span class="input-checkbox-span">I agree to the Privacy policy.</span>
</div>
<div class="col">
<button type="submit" class="send-button">SEND</button>
</div>
</div>
<a href="#intro" class="back-to-top"><img src="images\arrow-back.svg" /><span>Back to top</span>
</div>
</from>
You should start with cleaning up your markup, it is not valid HTML. There is a typo in your closing form tag (/from), an extra closing div tag, there is no input type of textare as far as I know, and you are missing white space around some classes. You can validate HTML here: https://validator.w3.org/
You can test to make sure your site is setup properly to send an email. There is a snippet for this called QuickEmail, download it from the extras tab in the MODX manager.
Once you're sure your site can send email, then start with a stripped down version of the Formit call -- remove all hooks except email and get it working with that first. Then add hooks one at a time.
I'm Using mongoDB and ejs to display all my users in a table. The table also has some action buttons to delete the user and to change the users role. The buttons open a popup to change the role or to confirm the deletion. But EJS doesn't pass the users info into the popup. It works totally fine in the table, but not in the popup.
My EJS User Table with the Role change Popup:
<tbody>
<%users.forEach(function(users){%>
<tr>
<td><%=users.name%></td>
<td><%=users.username%></td>
<td><%=users.createdAt%></td>
<td><span class="badge label-table badge-<%=users.role%>"><%=users.role%></span></td>
<td><span class="badge label-table badge-<%=users.verifyEmailToken%>"><%=users.verifyEmailToken%></span></td>
<td>
<button type="submit" class="btn btn-xs btn-success" data-toggle="modal" data-target="#con-close-modal" name="changeRoleButton"><i class="remixicon-user-settings-line"></i></button>
</td>
</tr>
<div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Change <%=users.name%> Role</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form class="" action="/changeuserrole" method="post">
<div class="modal-body p-4">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="field-1" class="control-label">User Role</label>
<select class="form-control" name="role">
<option>Partner</option>
<option>Admin</option>
<option>User</option>
</select>
</div>
<button type="submit" value="<%=users._id%>" name="userroleid" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<%});%>
</tbody>
Here is my app.js where I search for the users and pass them to EJS:
app.get("/users", function(req, res) {
if (req.isAuthenticated() && req.user.role === "Admin") {
User.find({}, function(err, foundUsers) {
if (err) {
console.log(err);
} else {
res.render("users", {
users: foundUsers,
name: req.user.name.replace(/ .*/, ''),
email: req.user.username,
});
}
});
} else {
res.redirect("/login");
}
});
All the <%=users...%> tags work inside the table, but not inside the popup divs. Inside the Popup it just displays the information from the first user in the Database, which is super strange.
I would be very thankful for any kind of help. Thanks!
Your ejs code is good. I think that the problem is the id of each modal.
For each user you generate a modal with id="con-close-modal", So all your modals have the same id. As a result, every submit button (all of them have the same data-target="#con-close-modal"), triggers the same modal, probably the first one.
I recommend you, give each modal a unique id like
<div id="<%= users._id %>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
and give each submit button the right data-target attribute
<button type="submit" ... data-target="#<%= users._id %>"...></button>
I may be wrong, but since the popup is displaying only the info from the first user, you may need the specific user id to be apart of the link. I had a similar issue with a project, except it was a link to a new view instead of a pop up.
I hope this documentation may be of some help
https://mongodb.github.io/node-mongodb-native/api-bson-generated/objectid.html
I am writing scripts for automating login action with credentials . I followed the standard process of finding the element through name , class , xpath . The input fields are not taking the credentials . I tried giving time interval of 10 seconds in between each process , still the issue continues.
Below I have attested the code .
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Firefox()
driver.get() #WEBSITE HERE
time.sleep(10)
elem = driver.find_element_by_xpath('//*[#id="ssousernameUI"]')
elem.clear()
elem.send_keys() # USERNAME HERE
elem.send_keys(Keys.RETURN)
time.sleep(10)
passwd = driver.find_element_by_xpath('//*[#id="password"]')
passwd.clear()
passwd.send_keys() #PASSWORD HERE
passwd.send_keys(Keys.RETURN)
time.sleep(10)
login = driver.find_element_by_link_text("Login")
login.click()
ERROR MESSAGE :
Traceback (most recent call last):
File "/home/think201/PycharmProjects/pat/pat-cbt/login.py", line 13,
in <module>
elem = driver.find_element_by_xpath('//*[#id="ssousernameUI"]')
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 368, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 858, in find_element
'value': value})['value']
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 311, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 237, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to
locate element: //*[#id="ssousernameUI"]
HTML code
<form name="loginForm" action="https://login.asdfghjk.in/oam/server/auth_cred_submit" target="_top" id="loginForm" method="POST">
<!-- Taksh End -->
<input name="ipRandomValue" value="709381701517861" id="ipRandomValue" type="hidden"><input name="deviceTypeHidden" value="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0" id="deviceTypeHidden" type="hidden">
<input name="ssousername" value="" id="ssousername" type="hidden">
<input name="hashnumber" value="" id="hashnumber" type="hidden">
<!-- Start mainWrapper -->
<div class="overlay"></div>
<div style="top: 20%;left: 50%;position: fixed;z-index: 5;color: white;display:none;" class="wait">
<h1>Please wait...</h1>
</div>
<div class="overlay1"></div>
<div class="mainWrapper">
<!-- Start Header -->
<!-- End Header -->
<!-- Start Middle Container -->
<article class="midContainer">
<div class="container">
<div class="breadcrums">
<p>You are here:</p>
<ul>
<li>Home</li>
<li class="last"> Login</li>
</ul>
</div>
<h1> Login</h1>
<section class="RHSsection standardWide">
<div class="pageWrap">
<div class="loginWrp">
<div class="box vfAcc">
<!-- displaying error message -->
<div class="cl c414042 bold fnt16"><p style="color:red;margin-left:10px;"><br><strong class="errMsgClass"></strong></p></div>
<div class="cl c414042 bold fnt16" id="SrvError"></div>
<div style="display:none;" class="cl c414042 bold fnt16 lockClass"><p style="color:red;margin-left:10px;"><br><strong>Your account is locked since it is
not used for a long time. Please click here to activate it</strong></p></div>
<!-- displaying error message end -->
<h3 class="accor">Login to manage your Account <span class="drop"></span></h3>
<div class="setWrp">
<div class="row">
<label>Enter your username or mobile number</label>
<div class="inputArea">
<div class="inputFieldBox">
<input name="ssousernameUI" autocomplete="off" class="login_input width255" value="" onfocus="if
(this.value==this.defaultValue)this.value='';" id="ssousernameUI" onblur="if(this.value=='')this.value=this.defaultValue;" type="text">
<div class="error_msg"></div>
</div>
</div>
</div>
<div class="row">
<label>Enter your password</label>
<div class="inputArea">
<div class="inputFieldBox">
<input name="password" autocomplete="off" id="password" class="login_input width255" onkeydown="if ((event.keyCode ==
13) && (document.getElementById('ssousernameUI').value!='') && (document.getElementById('passwordsrv').value!='')){LoginValidation();}" onblur="if(this.value=='')this.value=this.defaultValue;" value="" onfocus="if
(this.value==this.defaultValue)this.value='';" type="password">
<div class="error_msg"></div>
</div>
</div>
</div>
<div class="row">
<div class="checkboxBtn"> <span class="uncheked"></span>
<input name="checkbox" id="RememberMe" type="checkbox">
<label for="RememberMe"> Remember Me </label>
</div>
<div class="forgot"> Forgot your password?</div>
</div>
Login<!-- Add Here : Taksh -->
<!-- <div class="col orline"><span class="or">Or</span></div>
<ul class="smoShare">
<li class="facebook">Facebook</li>
<li class="gplus">Google Plus</li>
</ul> -->
</div>
</div>
<div class="box myvf">
<h3 class="accor">Why should I register ? <span class="drop"></span></h3>
<div class="setWrp">
<p>Here are 5 great reasons! </p>
<ul class="redbult">
<li>Simplified, dashboard view of voice & Internet usage</li>
<li> Easy update of profile & contact info</li>
<li> Quick change of voice & plans</li>
<li> Hassle-free access to old bills & statements of accounts</li>
<li> Instant activation/deactivation of services</li>
</ul>
<p>It takes just a few moments!</p>
Register Now
</div>
</div>
<div class="box vfApp">
<h3 class=""> App</h3>
<div class="">
<div class="vfappSlide">
<div class="owl-vfapp owl-carousel owl-theme owl-loaded">
<!-- <div class="apps"> <img src="/images/appimages/windows_logo.jpg" alt="" />
<p>Manage your account on the go !</p>
<div class="getNow"><a onclick="ga('send', 'event', 'My Account', 'Click', 'Windows - Get Now'); utag.link({ Custom_Links : 'MyAccount: Login: windows App - Get Now' });" href="http://qwertyu" class="purpleBtn">Get Now</a> </div>
</div>
<div class="apps"> <img src="/images/appimages/blackberry_logo.png" alt="" />
<p>Manage your Vodafone account on the go !</p>
<div class="getNow"><a onclick="ga('send', 'event', 'My Account', 'Click', 'Blackberry - Get Now'); utag.link({ Custom_Links : 'MyAccount: Login: Blackberry App - Get Now' });" href="http://qwerty" class="purpleBtn">Get Now</a> </div>
</div>
<div class="apps"> <img src="/images/appimages/nokia_ovi_logo.jpg" alt="" />
<p>Manage your account on the go !</p>
<div class="getNow"><a onclick="ga('send', 'event', 'My Account', 'Click', 'OVI - Get Now'); utag.link({ Custom_Links : 'MyAccount: Login: Ovi App - Get Now' });" href="http://qwertyu" class="purpleBtn">Get Now</a> </div>
</div>
<div class="apps"> <img src="/images/appimages/java_logo.jpg" alt="" />
<p>Manage your account on the go !</p>
<div class="getNow"><a onclick="ga('send', 'event', 'My Account', 'Click', 'Java - Get Now');utag.link({ Custom_Links : 'MyAccount: Login: Java App - Get Now' });" href="http://qwertyui" class="purpleBtn">Get Now</a> </div>
</div> -->
<div class="owl-stage-outer"><div class="owl-stage" style="transform: translate3d(-837px, 0px, 0px); transition: all 0.25s ease 0s; width: 1674px;"><div class="owl-item cloned" style="width: 279px; margin-right: 0px;"><div class="apps"> <img alt="" src="/images/appimages/android_logo1.jpg">
<p>Manage your Vodafone account on the go !</p>
<div class="getNow">Get Now </div>
</div></div><div class="owl-item cloned" style="width: 279px; margin-right: 0px;"><div class="apps"> <img alt="" src="/images/appimages/apple_logo1.jpg">
<p>Manage your Vodafone account on the go !</p>
<div class="getNow">Get Now </div>
</div></div><div class="owl-item" style="width: 279px; margin-right: 0px;"><div class="apps"> <img alt="" src="/images/appimages/android_logo1.jpg">
<p>Manage your Vodafone account on the go !</p>
<div class="getNow">Get Now </div>
</div></div><div class="owl-item active" style="width: 279px; margin-right: 0px;"><div class="apps"> <img alt="" src="/images/appimages/apple_logo1.jpg">
<p>Manage your account on the go !</p>
<div class="getNow">Get Now </div>
</div></div><div class="owl-item cloned" style="width: 279px; margin-right: 0px;"><div class="apps"> <img alt="" src="/images/appimages/android_logo1.jpg">
<p>Manage your account on the go !</p>
<div class="getNow">Get Now </div>
</div></div><div class="owl-item cloned" style="width: 279px; margin-right: 0px;"><div class="apps"> <img alt="" src="/images/appimages/apple_logo1.jpg">
<p>Manage your account on the go !</p>
<div class="getNow">Get Now </div>
</div></div></div></div><div class="owl-controls"><div class="owl-nav"><div class="owl-prev" style="display: none;">prev</div><div class="owl-next" style="display: none;">next</div></div><div style="" class="owl-dots"><div class="owl-dot"><span></span></div><div class="owl-dot active"><span></span></div></div></div></div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</article>
<!-- End Middle Container -->
</div>
<!-- End mainWrapper -->
</form>
NoSuchElementException is because webdriver is not able to find the element in the webpage. Check if there are any frames in the webpage. Switch to it, if any.
You will need to click the element to get that element to focus and then enter username/password details.
If that also does not work try wrapping your find element statement with explicit wait.
Let me know if that helps.
EDIT1:
elem.click();
elem.send_keys();
time.sleep(50);
EDIT2:
Instead of:
elem = driver.find_element_by_xpath('//*[#id="ssousernameUI"]')
you can try:
driver.find_element_by_xpath('//*[#id="ssousernameUI"]').click()
For the first look, it seems that you xpath is not a correct one.
Instead of using:
elem = driver.find_element_by_xpath('//*[#id="ssousernameUI"]')
Try this:
elem = driver.find_element_by_xpath("//*[#id='ssousernameUI']")
As per the HTML you have shared to fill up the credentials you can use the following code block :
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("your_website") #WEBSITE HERE
username = driver.find_element_by_xpath("//input[#id='ssousernameUI']").click()
username.clear()
username.send_keys("user_name") # USERNAME HERE
password = driver.find_element_by_xpath("//input[#id='password']").click()
password.clear()
password.send_keys("Pa$$w0rd") #PASSWORD HERE
driver.find_element_by_xpath("//a[#class='purpleBtn' and contains(.,'Login')]").click()
Thank You . I resolved it .
The website had multiple login pages , hence they have used iframe to suffice the Login access in multiple pages.
The issue was , the login was inside a iframe . I referred to the documentation for switching through frame.
I used
driver.switch_to_frame("frameName")
Thank you #Arun Prakash and everyone.
I am working on this as a free time project.
I would like to use Python 3 to login to a site (fill form and submit) and then I plan to scrape the page for some data. The reason I am strictly looking for a solution in Python 3 is because I am trying to learn more about Python and figured I would go straight to Python 3. I have seen several great looking tools such as mechanize but they only seem to support Python 2.
Planning to use this for a financial investment site but let's just use starbucks as an example.
def loginToStockSite(username, pwd):
url = "https://www.starbucks.com/account/signin"
values = {"Account.UserName" : username,
"Account.PassWord" : pwd}
data = urllib.parse.urlencode(values)
data = data.encode('utf-8')
req = urllib.request.Request(url, data)
sock = urllib.request.urlopen(req)
htmlSource = sock.read().decode('utf-8')
return htmlSource
I have gotten very confused from the various encode, decode, url opener, etc. examples. I have not found a solution that has worked for me yet.
Thanks in advance for any help with my "for fun" project.
Update
Here is the html I get back (with a bunch cut out to fit the character limit for a question)
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<title>Account Sign In | Starbucks Coffee Company</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<div class="fields">
<div class="region size1of1">
<div class="validation_summary warning validation_medium"><h2>Please Enable Cookies to Continue</h2><p>To sign in to the Starbucks web site, please enable cookies in your web browser.</p></div>
<div class="fields">
<form action="/account/signin" class="siren region size1of2" id="accountForm" method="post">
<fieldset class="login_position">
<legend class="hidden_visually">I have a Starbucks account.</legend>
<h2 class="existing_acc_h3">I have a Starbucks account.</h2>
<div id="user_info" class="region size1of2 reset">
Hi,
<span id="info_user"></span>
</div>
<div class="size1of2">
<a id="not_me" href="#notme">Not You?</a>
</div>
</div>
</div>
</div>
<div id="connect_cont" >
<div id="text_cont" class="hidden">
<h3>Have a Starbucks account?</h3>
<p>Connect your Facebook account to your Starbucks account by logging in here.</p>
</div>
</div>
</li>
<li>
<label for="Account_UserName">Username <span class="required">*</span></label>
<label for="Account_UserName" class="hidden">Starbucks Username <span class="required">*</span></label>
<input class="field_xlarge" id="Account_UserName" maxlength="200" name="Account.UserName" type="text" value="MY_USERNAME_WAS_HERE" />
</li>
<li>
<label for="Account_PassWord">Password <span class="required">*</span></label>
<label for="Account_PassWord" class="hidden">Starbucks Password <span class="required">*</span></label>
<input class="field_xlarge password" id="Account_PassWord" maxlength="200" name="Account.PassWord" type="password" value="MY_PASSWORD_WAS_HERE" />
</li>
<li>
Forgot your username or password?
<p class="privacy_policy hidden">
Concerned about privacy?
</p>
</li>
<li class="inline push">
<input type="checkbox" id="Account.IsRememberMe" name="Account.IsRememberMe" value="True" class="checkbox" />
<label for="Account.IsRememberMe">Keep me signed in.</label>
</li>
</ol>
</fieldset>
<fieldset>
<input id="ReturnUrl" name="ReturnUrl" type="hidden" value="" />
<input id="AllowGuest" name="AllowGuest" type="hidden" value="False" />
<input id="isJavaScriptDisabled" name="isJavaScriptDisabled" type="hidden" value="True" />
<span class="button"><button type="submit">Sign In</button></span>
</fieldset>
<fieldset class="submit">
<div id="fb_container">
<div id="fb_btn_cont">
Or log in using Facebook.
<p><a class="fb_button fb_button_medium" id="connect" href="#connect"><span class="fb_button_text">Login with Facebook</span></a></p>
</div>
</div>
</fieldset>
</form>
<div class="region size1of2 block_login">
<h2>I need a Starbucks account.</h2>
<p><span class="button">Create An Account</span></p>
<p>With a Starbucks account you can register and manage your Starbucks Cards and participate in My Starbucks Rewards.</p>
<ul class ="basic">
<li>Enjoy a free drink on your birthday</li>
<li>Protect your balance if your Starbucks Card is missing or stolen.</li>
<li>Transfer money between cards.</li>
<li>Track your earnings in My Starbucks Rewards</li>
<li>Reload your Card balance automatically</li>
</ul>
</div>
</div>
<div class="fields">
<div class="region size1of1">
<ul id="breadcrumb">
<li>Card .<ul>
<li>My Starbucks Rewards .<ul>
<li>View Your Stars</li>
</ul></li>
</ul></li>
</ul>
</div>
</div>
</div>
<div id="footer">
<div class="container">
<form id="search" method="get" action="/search">
<fieldset>
<input id="searchbox" name="keywords" title="Search Keyword" maxlength="100" class="search_input" />
<span class="button button_search"><button id="submit_search_util" type="submit">Search</button></span>
</fieldset>
</form>
<div class="fields">
<div class="region size5of6 suffix1of6">
<div class="footer_categorical"><ol class="blocks blocks-five-up">
<li><h4>
Buy a Card
</h4>
</li>
<li><h4>
Manage Your Card
</h4>
<ol>
<li>Check Balance</li>
<li>Reload Your Card</li>
<li>Transfer Funds</li>
<li>View Transactions</li>
</ol>
</li>
<li><h4>
My Starbucks Rewards
</h4>
<ol>
<li>Register Your Card</li>
<li>View Your Stars</li>
<li>Keep Your Gold Benefits</li>
<li>Rewards Program Terms and Conditions</li>
</ol>
</li>
<li><h4>
Learn More
</h4>
<ol>
<li>Card Terms and Conditions</li>
<li>What is a Starbucks Card eGift?</li>
<li>Card FAQs</li>
<li>Manage Your Account</li>
<li>My Starbucks Idea</li>
</ol>
</li>
I expected to get back a page like I get when I login in using a browser and have a div with the current balance on whatever the default gift card is that is registered.
<div class="balance-amount numbers">
That is the div that is visible. I found the balance in another place in the page source also but I do not see it on the page.
<p class="card_balance numbers">
<span>$27.68</span> <span class="datestamp">3/10/2013 2:12 PM</span>
</p>
Anyways, I would like to input the login info and submit the form using Python 3 or post the data somehow to login and then (as a use case but outside what is needed to answer the question) I would pull the account balance from the html.
I did find that my username and password are apparently in their corresponding fields and in the validation summary it says
<div class="validation_summary warning validation_medium"><h2>Please Enable Cookies to Continue</h2><p>To sign in to the Starbucks web site, please enable cookies in your web browser.</p></div>
I did see some examples that dealt with cookies. Is that the problem? I will research that possible solution. In the meantime, hope this helps you help me. Thanks.