Displaying HTML Content in Blackberry Browser Field? - browser

I am not able to display html content in Browser Field. I used UTF-8 encoding method. This is my HTML content
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'><html><head><title></title></head><body><p><strong>WELCOME … </strong></p>
<p style="text-align: center;"><span style="color: #003366;">WARNING! - Your life may never be the same after downloading this cool 'know yourself' tool… and it's fun!</span></p>
<p><span style="color: #003366;"><strong><em>Understand your relationships with your friends & family!</em></strong></span><br /><br /><span style="color: #003366;">Why can't I relate to my parents?</span><br /><span style="color: #003366;">Why do I argue with my best friend?</span><br /><br /><span style="color: #003366;"><em><strong>Find your Love-Match – in your fantasy or for real!</strong></em></span><br /><br /><span style="color: #003366;">Is my boyfriend/girlfriend right for me?</span><br /><span style="color: #003366;">How does my personality affect my sex-life?</span><br /><br /><span style="color: #003366;"><em><strong>Compare your personality with your favorite celebrity or sports star!</strong></em></span><br /><br /><span style="color: #003366;">What about …</span><br /><span style="color: #003366;">Paris Hilton? Tom Cruise? Hannah Montana? Justin Bieber? Taylor Swift?</span><br /><span style="color: #003366;">Mick Jagger? Ronaldo? or Justin Timberlake? … to name a few! </span><br /><span style="color: #003366;">More than 500 Musicians/Pop Stars, Sports Stars, Celebrities, Film Stars etc. online…! </span><br /><br /><span style="color: #003366;"><em><strong>Make the right career choice!</strong></em></span><br /><br /><span style="color: #003366;">What type of job will suit me best?</span><br /><br /><br /><span style="color: #003366;"><strong>It’s all about … </strong></span><strong><span style="color: #ffcc00;">p</span><span style="color: #ffcc00;">ersonalit</span><span style="color: #ffcc00;">y</span><em><span style="color: #003366;">, </span></em><span style="color: #ff0000;">personality</span><em><span style="color: #003366;">, </span></em><span style="color: #3366ff;">per</span><span style="color: #3366ff;">sonality</span><span style="color: #003366;">!</span></strong><br /><br /> <br /><span style="color: #003366;">Simply <strong>answer 15 questions</strong> and '<span style="color: #ff0000;">click</span>' to generate a report that gives you a <strong>unique personality profile</strong> including your <span style="text-decoration: underline;"><strong>individual</strong></span> combination of </span><strong><span style="color: #ffcc00;">YELLOW</span></strong><span style="color: #003366;">, </span><strong><span style="color: #ff0000;">RED</span></strong><span style="color: #003366;"> and </span><strong><span style="color: #3366ff;">BLUE</span></strong><span style="color: #003366;"> personality traits. </span><br /><br /><span style="color: #003366;"><strong>Press the '</strong></span><strong><span style="color: #3366ff;">HELP</span></strong><span style="color: #003366;"><strong>' function if you want to read more about the different personality types and our system of color coding.</strong></span><br /><span style="color: #003366;"><strong>Complete your test, then you can check your <span style="color: #ff0000;">celebrity love match</span> and check your personality with your friends, family and your choice of over 500 stars we have already listed online.</strong></span><br /><br /><span style="color: #003366;"><strong>And what about <span style="color: #ff0000;">your sexuality</span>??? … and </strong></span><strong><span style="color: #3366ff;">career choice</span></strong><span style="color: #003366;"><strong>???</strong></span><br /><br /><span style="color: #003366;"><strong>You can do 10 tests/reports and comparisons with family and friends <span style="color: #ff0000;">PLUS unlimited celebrity comparisons … DO IT NOW!</span></strong></span><br /><br /><span style="color: #003366;"><strong>This system is so simple, <span style="color: #ff0000;">quick</span>, easy and </strong></span><strong><span style="color: #3366ff;">accurate</span></strong><span style="color: #003366;"><strong> - it will amaze you!</strong></span><br /><br /></p>
<p style="text-align: center;"><span style="color: #003366;"><strong>LET THE FUN BEGIN … Go test yourself!</strong></span><br /><br /><img title="Take the test" src="http://www.personality-abc.frankmanson.com/website/admin/UserFiles/Image/Sales/take-the-test-sml.gif" alt="Take the test" width="150" height="88" /></p></body></html>
And this is my code
contentField=new BrowserField();
contentField.displayContent(content,"http://localhost");
I dont know what is the problem.

Try the following.
BrowserFieldConfig config = new BrowserFieldConfig();
HttpHeaders headers = new HttpHeaders();
headers.addProperty(HttpHeaders.HEADER_CONTENT_TYPE, HttpHeaders.CONTENT_TYPE_TEXT_HTML);
headers.addProperty(HttpHeaders.HEADER_ACCEPT_CHARSET, "UTF-8");
config.setProperty(BrowserFieldConfig.HTTP_HEADERS, headers);
BrowserField contentField = new BrowserField(config);
this.add(contentField); // add to screen
contentField.displayContent(content,"http://localhost"); // content -> your HTML content

Related

How can I extract the text from a div tag with style attribute set as "display: none;" through selenium

My html looks like this:
<div class="row">
<div class="col-md-7">
<ul class="breadcrumb">
<li id="get_data">Get data</li>
<li id="sampling_task">Sampling</li>
<li id="confirm_task">Confirmation</li>
</ul>
<div class="container-fluid">
<form action="#" method="post" enctype="multipart/form-data" role="form" class="form-horizontal">
{% csrf_token %}
<div class="form-group">
<label for="id_fileA" class="col-sm-3 control-label" style="text-align: left">
Select dataset A<span class='required_label'>*</span>
</label>
<div class="col-sm-9">
{{ form.fileA|attr:"class:form-control" }}
</div>
</div>
<div class="form-group"></div>
<div class="form-group">
<label for="id_fileB" class="col-sm-3 control-label" style="text-align: left">
Select dataset B<span class='required_label'>*</span>
</label>
<div class="col-sm-9">
{{ form.fileB|attr:"class:form-control" }}
</div>
</div>
<div class="form-group"></div>
<div class="form-group" id="sample_btn" style="display: none">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-9">
<input type="button" name="theButton" id="sample-step" value="Start Sampling" class="btn btn-success btn-large disabled" style="border-radius: 5px;">
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3" id="sample_msg" style="display: none;">
<p id="sample_text" style="font-size: medium">
Some ABCD message
</p>
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3" id="get_sample_confirm_msg" style="display: none;">
<p>
<input type="button" style="height: 40px; width: 140px; border-radius: 5px" name="YesButton" id="accept-step" value="Accept & Continue" class="btn btn-success disabled">
<input type="button" style="height: 40px; width: 140px; border-radius: 5px" name="NoButton" id="cancel-step" value="Cancel Sampling" class="btn btn-danger disabled">
</p>
</div>
</div>
</form>
</div>
</div>
<div class="col-md-5">
</div>
</div>
The backend is a javascript and on button click, it do processing and if something fails the javascript code update the message.
var error = "<div class='alert alert-danger'><p>We encountered an error while sampling: <br /><strong>Sampling failed!!</strong></p>"; error += "<p>Please <a href='mailto:abcd#gmail.com'>contact us</a> if this error persists.</p>";
error += "</div>";
$('#sample_msg').html(error);
Now, in my selenium code if I do this:
sample_msg = self.driver.find_element_by_id('sample_msg')
I get an empty list result. What I want is to do is read the error in the "sample_msg" class if any and I have tried few things but its not working out. Help is appreciated. Thanks.
If you want to get access to hidden text you might need to use below code:
sample_msg = self.driver.find_element_by_id('sample_msg').get_attribute('textContent').strip()
Note that text property allows to get text from visible elements only
As you are trying to extract the error message Some ABCD message it is contained within a <p> tag which have parent <div> tag with style attribute set as display: none;. So to extract the text you can use the following code block :
element = driver.find_element_by_xpath("//div[#class='form-group']/div[#id='sample_msg']")
driver.execute_script("arguments[0].removeAttribute('style')", element)
print(driver.find_element_by_xpath("//div[#class='form-group']/div[#id='sample_msg']/p").get_attribute("innerHTML"))
So, you have to wait for sometime after clicking the button and once some message appears then you need to extract that message.
Try below:-
WebDriverWait wait = new WebDriverWait(webDriver, timeoutInSeconds);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id));
or
wait.until(ExpectedConditions.elementToBeClickable(By.id));
to be precise.
See also:
org.openqa.selenium.support.ui.ExpectedConditions for similar shortcuts for various wait scenarios.
org.openqa.selenium.support.ui.WebDriverWait for its various constructors.
You can check the python syntax also on the above links.

I don't know how to get text from not close tag using beautifulSoup

<hr class="calibre2" />
<h3 class="calibre5">-ibility</h3> (in nouns 构成名词) : <br
class="calibre4" />
<blockquote class="calibre6"><p class="calibre_1"><span class="italic">◊
capability 能力 </span></p></blockquote>
<blockquote class="calibre6"><p class="calibre_1"><span class="italic">◊
responsibility 责任 </span></p></blockquote>
<hr class="calibre2" />
<h3 id="calibre_link-1" class="calibre5">-able</h3> □<span
class="bold"><span class="italic"><span class="calibre_2"> suffix</span>
</span></span> (in adjectives 构成形容词) <br class="calibre4" />
<span class="bold">『1』</span>that can or must be 可…的;能…的;应…的 :
<br class="calibre4" />
<blockquote class="calibre6"><p class="calibre_1"><span
class="italic">◊ calculable 能计算的 </span></p></blockquote>
<blockquote class="calibre6"><p class="calibre_1"><span
class="italic">◊ taxable 应纳税的 </span></p></blockquote>
<span class="bold">『2』</span>having the quality of 具有…性质的 : <br
class="calibre4" />
<span class="bold"><span class="calibre_3">-ability, -ibility </span>
</span>
<hr class="calibre2" />
<h3 class="calibre5">-ible</h3> □<span class="bold"><span
class="italic"><span class="calibre_2"> suffix</span></span></span> (in
adjectives 构成形容词) <br class="calibre4" />
<blockquote class="calibre6"><p class="calibre_1"><span
class="italic">◊ comfortable 舒适 </span></p></blockquote>
<blockquote class="calibre6"><p class="calibre_1"><span
class="italic">◊ changeable 易变 </span></p></blockquote>
<span class="bold"><span class="calibre_3">-ability, -ibility </span>
</span>
<hr class="calibre2" />
<h3 class="calibre5">-acy</h3> ⇒ <span class="bold">-cy</span>
<br class="calibre4" /> □<span class="bold"><span
class="italic"><span class="calibre_2"> suffix</span></span>
</span>
<blockquote class="calibre6"><p class="calibre_1"><span
class="italic">◊ chaplaincy 专职司铎的职位 </span></p></blockquote>
<hr class="calibre2" />
<h3 class="calibre5">-age</h3> □<span class="bold"><span
class="italic"><span class="calibre_2"> suffix</span></span></span>
(in nouns 构成名词) <br class="calibre4" />
Above code is I use Calibre to transfer from a English dictionary into html and then extract into html, but they they only add some none close tag, as you can see, between <hr class = 'calibre2'>... <hr class = 'calibre2'> content is I need, like: I want to get like: (word: meaning:), inside h3 is the words, and easily to get use beautifulsoup.findall('h3').text, and right now I know how to get between <hr>.. <hr> contents, but only contents, I don't know how to get only text. because <hr> is not a close tag, so I couldn't directly use tag.text to get.
So, I think maybe I could use wrap or new_tag, but seems not work for me maybe I misuse them, I want to add <div class= num> sth, between the 2 tag, so I could directly get it. and use tag.text to get them.
thank you.

Special 2 Column Layout with CSS

I have been trying to come up with a special 2 column layout.
Basically these are the requirements
Fixed width and centered
Height 100%
Header and Footer always visible
2 column content ( Main - Right )
Main column scroll on overflow
Right column fixed
Here is the code I have so far. I just haven't been able to center
the entire layout.
Live at www.onlinesportcenter.com
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SPECIAL 2 COLUMN LAYOUT</title>
<style type="text/css">
body {
margin:0;
border:0;
padding:0;
height:100%;
max-height:100%;
background:#fff;
font-family:arial, verdana, sans-serif;
font-size:76%;
overflow: hidden;
}
* html body {
padding:120px 0 20px 0;
}
#header {
position:absolute;
top:0;
left:0;
width:1004px;
height:119px;
overflow:auto;
background:#73a2bd;
border-bottom:1px solid #35759a;
text-align:center;
}
* html #header {height:120px;}
#header p {
color:#fff;
margin:2px 0 0 0;
}
#header ul {
clear:both;
text-align:center;
border-top:1px solid #73a2bd;
}
#header ul {
margin:0;
padding:0;
list-style-type:none;
background:transparent;
height:3em;
}
#header ul li {
display:inline;
color:#73a2bd;
}
#container {
font-family: Arial, sans-serif;
font-size: 1.2em;
position:fixed;
top:120px;
left:0;
bottom:20px;
right:0;
background:#fff;
padding:0;
width:1004px;
}
* html #container {
height:100%;
width:1004px;
}
#container img {margin:5px;}
#main {
width:774px;
height:100%;
float:left;
overflow:auto;
}
#right {
width:228px;
height:100%;
float:right;
border-left:1px solid #73a2bd;
border-right:1px solid #73a2bd;
}
#footer {
position:absolute;
bottom:0;
left:0;
width:1004px;
height:19px;
overflow:auto;
text-align:center;
background:#73a2bd;
border-top:1px solid #35759a;
}
* html #footer {height:20px;}
#footer p {
color:#fff;
margin:2px 0 0 0;
}
</style>
</head>
<body>
<div id="header">
<p>HEADER</p>
</div>
<div id="container">
<div id="main">
<p>
MAIN
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
</p>
</div>
<div id="right">
<p>
RIGHT
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
</p>
</div>
</div>
<div id="footer">
<p>FOOTER</p>
</div>
</body>
</html>
Wrap all top-level elements (header, container and main) in another div, give it a set width and a the following margin: "margin:0 auto;"
EDIT: I take my words back. I misunderstood your initial problem. For header and footer you need to wrap them in a absolute positioned div anchored to the top or bottom. Make sure those elements have width to 100%. Then set margin to "0 auto" for inside elements. I'll post a JS Fiddle example in a sec.
EDIT 2: Here's what I got so far: http://jsfiddle.net/NfSKf/

radio buttons won't deselect when another button is selected in dreamwever cs5

enter link description hereenter code here My problem is that the radio buttons won't deselect once selected. This form is connected to a php file that I build for my homework. In Dreamweaver if I keep the default value for the name attribute I don't have a problem with the buttons, but since the value of the name attribute has to match the name attribute in the php file I can't keep the default name. I've tried using group buttons and single buttons and copying them. In a text page I was able to get buttons to deselect when another button was selected. And then it stopped working, all the buttons stayed checked. I'm confused because I thought radio buttons contained boolean values, when one is selected the other is deselected. Any suggestions? Here is the code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1 /DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Homework 7</title>
<script type="text/javascript">
function edits()
{
if(document.getElementById("name").value=="")
{
alert("Please enter your whole name.")
return false;
}
if(document.getElementById("jarreau").checked=="")
{
alert("Please enter your whole name.")
return false;
}
else if(document.getElementById("aretha").checked=="")
{
alert("Please enter your whole name.")
return false;
}
else if(document.getElementById("withers").checked=="")
{
alert("Please enter your whole name.")
return false;
}
else if(document.getElementById("joel").checked=="")
{
alert("Please enter your whole name.")
return false;
}
else if(document.getElementById("warwidk").checked=="")
{
alert("Please enter your whole name.")
return false;
}
if(document.getElementById("rate").value=="")
{
alert("Please enter your whole name.")
return false;
if(document.getElementById("email").value=="")
{
alert("Please enter your whole name.")
return false;
}
}
else return true;
}
</script>
<style type="text/css">
body {
background-color: #F9F;
}
h1 {
font-size: xx-large;
color: #FFF;
}
</style>
</head>
<body>
<h1 font color="#fff">Old School Concert</h1>
<table width="87%" border="0" cellspacing="0" cellpadding="2">
<tr>
<th align="left" width="19%" scope="col">Al Jarreau</th>
<th align="left"width="13%" scope="col">Aretha Franklin</th>
<th align="left"width="16%" scope="col">Bill Withers</th>
<th align="left"width="19%" scope="col">Billy Joel</th>
<th align="left"width="19%" scope="col">Dionne Warwick</th>
</tr>
<tr>
<td><img src="al jarreau.jpg" width="247" height="204" alt="Al Jarreau" /></td>
<td><img src="images/aretha franklin.jpg" width="198" height="204" alt="aretha franklin" /></td>
<td><img src="Bill Withers.jpg" width="192" height="204" alt="Bill Withers" /></td>
<td><img src="billy joel.jpg" width="225" height="204" alt="Billy Joel" /></td>
<td><img src="Dionne Warwick.jpg" width="176" height="204" alt="Dionne Warwick" /></td>
</tr>
In order to keep bringing you the best in old school legends please fill out this brief survey.
<form name="service" method="post" action="concert.php" />
<label for="fname">First name:</label>
<input name="name" type="text" id="fname" size="20" maxlength="15" />
(optional)
<br />
<label for="lname">Last name:</label>
<input name="name" type="text" id="lname" size="20" maxlength="15" />
(optional)<br />
<label>Which performance you liked best:</label><br />
<p>
<label>
<input type="radio" name="jarreau" value="radio" id="RadioGroup1_0"/>
Al Jarreau</label>
<br />
<label>
<input type="radio" name="aretha" value="radio" id="RadioGroup1_1" />
Aretha Franklin</label>
<br />
<label>
<input type="radio" name="withers" value="radio" id="RadioGroup1_2" />
Bill Withers</label>
<br />
<label>
<input type="radio" name="joel" value="radio" id="RadioGroup1_3" />
Billy Joel</label>
<br />
<label>
<input type="radio" name="warwick" value="radio" id="RadioGroup1_4" />
Dionne Warwick</label>
</p>
<br />
<label for="rate">On a scale of 1 to 10 how would you rate this concert?</label>
<br />
<input name="rate" type="text" id="rate" size="5" maxlength="2" />
<label for="email"><br />
Your email address:</label>
<br />
<input name="email" type="text" id="email" size="45" maxlength="45" />
</p>
<p>
<label for="comment">Your comments:</label>
<textarea name="comment" cols="50" rows="5" id="comment"></textarea>
</p>
<input type="button" value="submit" name="" id="" onclick="edits()" />
</form>
</body>
</html>
you have to give all the radio buttons the same "name" like:
<input name="thesamegroup" type="button" value="submit" id="" onclick="edits()" />
<input name="thesamegroup" type="text" id="email" size="45" maxlength="45" />

Number of Search Results from Excel

Given a column of strings I would like to find the number of search results from a website (e.g. sciencedirect.com) for each string. An existing answer Number of Google Results from Excel works well for Google.
Unfortunately this solution creates the search URL from the string i.e. a Google search for example contains the word example. The sites I want to use do not do this.
A search for example returns the URL http://www.sciencedirect.com/science?_ob=ArticleListURL&_method=list&_ArticleListID=1860967815&_sort=r&_st=13&view=c&_acct=C000053194&_version=1&_urlVersion=0&_userid=1495569&md5=0ef30742e917da15236ef1824058a1db&searchtype=a
Any idea how I achived the same result with this type of search engine.
You'll have to examine the form you submit when you click on the Search button. The form sends a GET request which containes the search terms, but then you get redirected to the result list page, and the URL of the results page does not contain the search terms any more.
I have successfully searched for "corpus" with this URL:
http://www.sciencedirect.com/science?_ob=QuickSearchURL&_method=submitForm&_acct=C000228598&_origin=home&_zone=qSearch&md5=61ce8901b141d527683913a240486ac4&qs_all=corpus
Note that what you'll have to do is
download the start page http://www.sciencedirect.com/
extract hidden fields from the search form
assemble the search URL from the hidden fields
add your search term to the search URL in the qs_all field
send GET request with the search URL
follow redirection
Except for qs_all all other fields in this URL comes from the the form as hidden fields.
This is the source of the corresponding form, as I downloaded it (before sending the "corpus" search request.):
<form name="qkSrch" method="get" target="_top" action="/science" style="margin:0px;">
<input type="hidden" name="_ob" value="QuickSearchURL">
<input type="hidden" name="_method" value="submitForm">
<input type="hidden" name="_acct" value="C000228598">
<input type="hidden" name="_origin" value="home">
<input type="hidden" name="_zone" value="qSearch">
<input type="hidden" name="md5" value="61ce8901b141d527683913a240486ac4">
<table border="0" width="100%" cellpadding="0" cellspacing="0" style="margin: 0;">
<tbody><tr valign="middle">
<!-- Code related for toggling labels -->
<td align="right"><label for="qs_all" id="fieldLabel"> All fields</label></td>
<td align="left"><input class="textbox qsinput xpstyle" type="text" name="qs_all" id="qs_all" value="" size="30" maxlength="450" title="For example: heart attack AND behavior?" tabindex="1"></td>
<td align="right"><label for="qs_author"> Author</label></td>
<td align="left" colspan="5"><input class="textbox qsinput xpstyle" type="text" name="qs_author" id="qs_author" value="" size="33" maxlength="450" title="e.g. J S Smith or John Smith or Smith JS" tabindex="2" style="_width:100%"></td>
<td nowrap="nowrap">
</td><td></td><td></td>
<td align="right" nowrap="nowrap" width="90%" valign="middle">
Advanced search
</td>
</tr>
<tr>
<td align="right"><label for="qs_title"> Journal/Book title</label></td>
<td align="left"><input class="textbox qsinput xpstyle" type="text" id="qs_title" name="qs_title" value="" size="30" maxlength="450" title="For example: journal of molecular biology" tabindex="3"></td>
<td align="right" class="toggleQukSrch2"><label for="qs_vol" id="volField"> Volume</label></td>
<td align="left" class="toggleQukSrch"><input class="textbox qsinput xpstyle" type="text" name="qs_vol" id="qs_vol" value="" size="3" maxlength="10" style="width:30px;" tabindex="4"></td>
<td align="right" class="toggleQukSrch2"><label for="qs_issue" id="issueField"> Issue</label></td>
<td align="left" class="toggleQukSrch"><input class="textbox qsinput xpstyle" type="text" name="qs_issue" id="qs_issue" value="" size="3" maxlength="10" style="width:30px" tabindex="5"></td>
<td align="right" class="toggleQukSrch2"><label for="qs_pages" id="pageField"> Page</label></td>
<td align="right" class="toggleQukSrch"><input class="textbox qsinput xpstyle" type="text" name="qs_pages" id="qs_pages" value="" size="3" maxlength="10" title="For example: 14-27" style="width:30px" tabindex="6"></td>
<td align="right" nowrap="nowrap">
<input class="button" id="submit_search" type="Submit" alt="Submit Quick Search" title="Submit Quick Search" value="Search ScienceDirect" tabindex="8" name="sdSearch">
</td>
<td align="right" nowrap="nowrap" colspan="8" valign="bottom">
<a class="icon_qmarkHelpsci_dir" href="/science?_ob=HelpURL&_file=qs_tips.htm&_acct=C000228598&_version=1&_urlVersion=0&_userid=10&md5=2bd779305b31602341744eaa786e2f0a" target="sdhelp" onmouseover="window.status='Help is Available';return true" onmouseout="window.status='';return true" onclick="var helpWin;helpWin=window.open('/science?_ob=HelpURL&_file=qs_tips.htm&_acct=C000228598&_version=1&_urlVersion=0&_userid=10&md5=2bd779305b31602341744eaa786e2f0a','sdhelp','scrollbars=yes,resizable=yes,directories=no,toolbar=no,menubar=no,status=no,width=760,height=570');helpWin.focus();return false" tabindex="9" style="font-size:0.92em;padding-right:0;">Search tips</a>
</td>
</tr>
</tbody></table>
</form>
EDIT
Continued with How to extract the number of results from the results page.
Your assumption is right, you'll have to change other parts of the code, namely that extracts the number of results value.
Let's stick with the previous example.
When searching from "corpus", you will find this line in the source of the result page:
<input type="hidden" name="TOTAL_PAGES" value="2836">
And you'll want to extract 2836. Hence you will search for something like <input type="hidden" name="TOTAL_PAGES" value=" and get the subequent value before the closing quote.
I am not going to tell you how to code in VBA, but it is basic String manipulation so I hope you can handle it.

Resources