Getting Through Proxy Server with Python - python

I am trying to get through a proxy server through python to extract some information from the website, so far I this piece of code, but it doesnt seem to be working
import requests
import BeautifulSoup
URL = 'http://proxy.library.upenn.edu/login?url=http://clients1.ibisworld.com/'
session = requests.session()
# This is the form data that the page sends when logging in
login_data = {
'pennkey': "****",
'password': "****",
'submit': 'login',
}
# Authenticate
r = session.post(URL, data=login_data)
doc = BeautifulSoup.BeautifulSoup(r.content)
print doc
edit: this is what this prints:
Gorkems-MacBook-Pro:desktop gorkemyurtseven$ python extract.py
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta name="HandheldFriendly" content="True" />
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, minimum-scale=.5" />
<title>University of Pennsylvania Libraries Proxy Service - Login</title>
<link href="/public/proxysm.css" media="print, screen" rel="stylesheet" type="text/css" />
<script language="javascript">
function validate(){
var isgoldcard = document.authenticate.pass.value;
var isgoldcardRegxp = /00000/;
if (isgoldcardRegxp.test(isgoldcard) == true)
alert("Authentication is by PennKey only.");
}
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-982196-4']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!--[if IE]>
<style>
table, form .limitwidth {width: 252px;}
.holdsubmit {width: 143px;}
</style>
<![endif]-->
</head>
<body onload="document.authenticate.user.focus();">
<div id="logostripe">
<div><img src="/public/librarieslogologin.gif" border="0" alt="Penn Libraries Home" /></div>
</div>
<h1>Libraries Proxy Service</h1>
<div id="holder">
<form name="authenticate" action="https://proxy.library.upenn.edu/login" method="post" autocomplete="off">
<div class="limitwidth">
<input type="hidden" name="url" value="http://clients1.ibisworld.com/" />
<script type="text/javascript">
var t = location.search;
t = t.substr(t.indexOf('proxySessionID')+15,t.indexOf('&')-16);
document.cookie="proxySessionID="+escape(t)+"; path=/; domain=.library.upenn.edu";
</script>
<table align="center" cellspacing="0" cellpadding="2" border="0">
<tr>
<td class="holdlabels"><label for="user">PennKey:</label></td>
<td><input type="text" name="user" /></td>
</tr>
<tr>
<td><label for="password">Password:</label></td>
<td><input type="password" name="pass" onblur="validate(); return false;" /></td>
</tr>
<tr>
<td></td>
<td class="holdsubmit">
<div><input type="submit" value="Login" /></div>
</td>
</tr>
</table>
</div>
</form>
<ul class="moreinfo">
<li><a class="menuitem" href="http://www.upenn.edu/computing/pennkey">PennKey information</a></li>
</ul>
<div class="notices">
The Library Proxy Service allows you to use
domain-restricted resources & services by authenticating yourself as Penn Faculty,
Student, or Staff.
</div>
<div class="alert">
Please note limitations on the use of restricted online resources.
<br /><br />
PennKey holders must be current faculty, student, or staff, have valid University PennCommunity credentials and abide by stated Restrictions On Use.
<br /><br />
In addition, users agree to the University's Appropriate Use Policy.
</div>
</div><!-- close holder -->
</body>
</html>

Here's a solution that works for me (also using Penn's proxy server):
import requests
from bs4 import BeautifulSoup
proxies = {'https': 'https://proxy.library.upenn.edu'}
auth = requests.auth.HTTPProxyAuth('[username]', '[password]')
r = requests.get('http://www.example.com/', proxies=proxies, auth=auth)
print BeautifulSoup(r.content)
The first key is that the proxy server is https, and not http (this took me far too long to figure out). Next, you must use the requests.auth.HTTPProxyAuth method for authenticating with the server. Once, you set these two vars, however, you should be able to navigate wherever you need.

Related

How to import another python script with HTML code

I have 2 scripts. One is my main.py script where it will call my other script to print an HTML page. The second script is html_pages.py. I'm trying to print an HTML page by importing html_pages.py and calling the welcome_page or login_page function.
Whenever I try to reach the page it says "Internal error". This was working previously when I had the login_page and welcome_page as a string stored in the main script. But it doesn't work when I try to call the function from a different script.
my main.py script contains:
#!/usr/bin/python3
import html_pages
if "HTTP_COOKIE" in os.environ :
cookie_info = os.environ["HTTP_COOKIE"]
cookies = cookie_info.split(';')
for cookie in cookies:
cookie_split = cookie.split('=')
cookie_dict[cookie_split[0].strip()] = cookie_split[1].strip()
CookieUsername = cookie_dict.get('username')
CookiePassword = cookie_dict.get('password')
CookieToken = cookie_dict.get('CSRFtoken')
#Connect to the database
import pymysql
conn = pymysql.connect(db='project2', user='algarcia1', passwd='root', host='localhost')
c = conn.cursor()
#Collect info about the user
query = "SELECT * FROM bank WHERE username='{CookieUsername}'"
c.execute(query.format(CookieUsername=CookieUsername))
conn.commit()
user = c.fetchone()
print(html_pages.welcome_page(user[0],user[3],user[4]))
else:
cookie_dict["username"] = "undefined"
cookie_dict["password"] = "undefined"
print(html_pages.login_page())
My HTML_pages.py script looks like this:
#!/usr/bin/python3
#Create a login HTML page
def login_page(status):
loginpage = """Content-Type: text/html
<!DOCTYPE html>
<!-- HTML code to send a POST request to login.py -->
<html>
<head>
<title>Safe Bank Website</title>
</head>
<body>
<form action="login.py" method="POST">
<h1>Safe Bank Website</h1>
<strong>Username:</strong><br>
<input type="text" name="username"><br>
<strong>Password:</strong><br>
<input type="text" name="password"><br>
<strong>CSRF token:</strong><br>
<input type="text" name="CSRFtoken"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>"""
print(login_page.format())
def welcome_page(username, chequings, savings):
#Create a welcome HTML page
welcomepage = """Content-Type: text/html
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {{ border: 2px solid black; text-align: left;}}
th, td {{ padding: 5px; }}
</style>
</head>
<body>
<h2>Welcome {cookie_info}!</h2>
<table style="width:100%">
<tr>
<th>Chequings</th>
<th>Savings</th>
</tr>
<tr>
<td>{chequings}</td>
<td>{savings}</td>
</tr>
</table>
Transfer money
</body>
</html>"""
print(welcome_page.format(cookie_info=username,chequings=chequings,savings=savings))
There are so many good python Web-Frameworks like Flask or Django. That make it easy so build webpages in a secure way. Especially Flask is very easy to use. Try them out and look how such frameworks do it.
In most cases it's more solid for future use to use a framework where you have a good structure.

Python requests with login credentials

I am trying to login to a URL & download the content then parse, the URL needs username & password to login.
using below gives below errors:
import requests
url = 'https://test/acx/databaseUsage.jssp?object=all'
values = {'username': 'test_user',
'password': 'test_pswd'}
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
r = requests.post(url, data=values, headers=headers)
print r.content
Error log output from above code:
tried with below values as well , without any success
values = {'Login': 'test',
'Password': 'test',
'Log in': 'submit'}
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/> <!-- must be first; see SD5930 -->
<title>Test URL login</title>
<!--meta name="apple-mobile-web-app-capable" content="yes" /-->
<link type="text/css" rel="StyleSheet" href="/nl/logon.css"></link>
</head>
<body onLoad="setFocus();">
<div id="htmlContent">
<div id="container">
<div id="content">
<div class="login_frame">
<div class="header_login">
<img src="/nl/img/logo.png" alt="Test URL" />
</div>
<div id="form-main">
<!--[if lte IE 7]>
<div class="warning"><b>Warning</b>: your browser isn't supported by Test URL. <br/>To be able to use Test URL to its full potential, you need to update your browser.</div>
<![endif]-->
<form method="POST" autocorrect="off" autocapitalize="off" name="loginForm" action="/nl/jsp/logon.jsp">
<input type="hidden" name="action" value="submit" />
<input type="hidden" name="target" value="/acx/databaseUsage.jssp?object=all">
<p class="input first">
<label for="login">Login</label>
<span>
<input id="login" name="login" tabindex="1" type="text" value="" />
</span>
</p>
<p class="input">
<label for="password">Password</label>
<span>
<input id="password" name="password" tabindex="2" type="password" autocomplete="off" />
</span>
<br />
</p>
<p class="memorize submit last">
<input id="rememberMe" name="rememberMe" class="checkbox" tabindex="3" type="checkbox" />
<label class="checkbox" for="rememberMe">Keep me logged in</label>
<button id="validate" type="submit">Log in</button>
</p>
</form>
</div>
</div>
</div>
</div>
<div id="footer" class="dashboardFooter">
<div id="footerContent" class="nlui-pageWidth">
<p>
© Test URL 2017
</p>
</div>
</div>
</div>
<script type="text/javascript">
function setFocus() {
document.loginForm.login.focus();
}
</script>
</body>
</html>
Image of login page
In order to login successfully you'll have to submit the correct data to the correct URL. You can get those values from the HTML form, or by inspecting the network traffic in your browser. Also, you may want to gather any authenticated cookies.
Make sure to use the correct URL. You can get that URL from the form's action attribute (if the form has no action it is submitted to the URL that hosts it). If you examine the form you'll see that it is submitted to: "/nl/jsp/logon.jsp".
Make sure to include all required data. If the form contains hidden inputs they should be included in the POST data. It is important to submit all the form fields because they may contain essential data.
You can use a Session() object to store your cookies. This will collect and use cookies (and other parameters) across requests, and so you can access the site as an authenticated user.
If you want to set or change headers you can use either the headers parameter or the Session.headers attribute - which wil use those headers for all requests. Usually changing the default User-Agent is enough, but some sites may expect more headers (a valid Referer for example).
import requests
url = 'https://example.com/nl/jsp/logon.jsp'
post_data = {
'login': 'username',
'password': 'password',
'target':'/acx/databaseUsage.jssp?object=all',
'action':'submit'
}
with requests.Session() as s:
s.headers['User-Agent'] = 'My user-agent'
r = s.post(url, data=post_data)
print(r.text)
If you still can't login you may have to use Selenium. Sometimes JavaScript is involved in the login process and requests doesn't run JavaScript code. It may be possible to reverse-engineer this process but it would be much easier/better to use Selenium.

python flask render_template html did not render correctly

I'm building a python flask app implementing user log in , after user log in succefully, it will redirect to userHome.html
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Python Flask Bucket List App</title>
    <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
 
    <link href="http://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css" rel="stylesheet">
    <link href="../static/css/signup.css" rel="stylesheet">
</head>
<body>
    <div class="container">
        <div class="header">
            <nav>
                <ul class="nav nav-pills pull-right">
                    <li role="presentation" class="active">Logout
                    </li>
                </ul>
            </nav>
            <h3 class="text-muted">Python Flask App</h3>
        </div>
 
        <div class="jumbotron">
            <h1>Welcome Home !!</h1>  
        </div> 
        <footer class="footer">
            <p>© Company 2015</p>
        </footer>  
    </div>
</body>
</html>
and the python code to perform return render_template('userHome.html')
in validateLogin :
#app.route('/validateLogin',methods=['POST'])
def validateLogin():
cursor = None
try:
_username = request.form['inputName']
_password = request.form['inputPassword']
# connect to mysql
conn = mysql.connect()
cursor = conn.cursor()
cursor.callproc('sp_validateLogin',(_username,_password))
data = cursor.fetchall()
if len(data) > 0:
return render_template('userHome.html')
else:
return render_template('error.html', error = "Wrong Username or
Password")
except Exception as e:
return render_template('error.html',error = str(e))
finally:
if cursor:
cursor.close()
conn.close()
and the signin.js :
$(function(){
$('#btnSignIn').click( function(){
$.ajax({
url: '/validateLogin',
data: $('form').serialize(),
type: "POST",
success: function(response){
console.log(response);
},
error: function(error){
console.log(error);
}
});
});
});
and finally the signin.html:
!DOCTYPE html>
<html lang="en">
<head>
<title>Sign In</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="http://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css" rel="stylesheet">
<link href="../static/signup.css" rel="stylesheet">
<script src="/static/js/jquery-3.1.1.js"></script>
<!--<script src="/static/js/jquery-3.1.1.min.map"></script>-->
<script src="/static/js/signin.js"></script>
</head>
<body>
<div class="container">
<div class="header">
<nav>
<ul class="nav nav-pills pull-right">
<li role="presentation" >Home</li>
<li role="presentation" class="active">Sign In</li>
<li role="presentation">Sign Up</li>
</ul>
</nav>
<h2 class="text-muted">Release Control System</h2>
</div>
<div class="jumbotron">
<h1>Log In</h1>
<form class="form-signin">
<label for="inputName" class="sr-only">Name</label>
<input type="name" name="inputName" id="inputName" class="form-control" placeholder="Name" required autofocus>
<!--<label for="inputEmail" class="sr-only">Email address</label>
<input type="email" name="inputEmail" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>-->
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" name="inputPassword" id="inputPassword" class="form-control" placeholder="Password" required>
<button id="btnSignIn" class="btn btn-lg btn-primary btn-block" type="button">Sign in</button>
</form>
</div>
<footer class="footer">
<p>Copyright 2017 Foxconn CABG © All Rights Reserved.</p>
</footer>
</div>
</body>
</html>
but when I log in successfully it does not direct to the userHome.html page, it showed all html entities instead. Meaning the templates are working but the browser is treating wrongly.
I've tried many tricks like:
headers = {'Content-Type': 'text/html'}
return make_response(render_template('userHome.html'),200,headers)
but it still returns html entities, not html page.
This has confused me for days, thanks in advance.
Since I don't know how to send a redirect request to ajax and execute it. I will simply share the way I do things.
# Python Code
#app.route('/login')
def login():
# check if user is not logged in then render the login form
if user_not_logged_in():
return render_template('login_form.html')
# if user logged in, then redirect to userHome
else:
return redirect(url_for('userHome'))
from flask import jsonify
#app.route('/validateLogin', methods=['POST'])
def validateLogin():
# do some stuff and check for validation
if stuff_goes_well:
return jsonify({'data': 'success'})
else:
return jsonify({'data': 'failure'})
#app.route('/userHome')
def userHome():
# check if user is logged in
if logged_in_user_session_exists():
return render_template('userHome.html')
else:
# user is not logged in so redirect him to the login page
return redirect(url_for('login'))
# jQuery code
$.ajax({
url: "/validateLogin",
type: "POST",
dataType: "json",
data: data_here,
success: function(response){
if(response.data == 'success'){
# success was sent so the user logged in successfully, redirect to user home
window.location.replace('/userHome');
}else{
# there was an error in the logging in
alert('there was an error!');
}
}
});
To sum it up in a few words: simply send your data with ajax to Python. then let Python handle verification and the analysis of the data. then if all goes well, tell jQuery " hey it's all cool here " ( which is represented by the 'success' string we send ). if something was wrong then we tell jQuery that we had a problem hence the 'failure' string we send. then in jQuery we act upon the string that was sent. if it was success, then we redirect the user to the desired URL ( which is /userHome in this case ). if failure was sent then we say there was an error.
Please notice that these python checks are important so the user just doesn't type "/userHome" in the URL and be able to just view the page while he is not logged in.
I hope you find this useful.

Retrieving value from Python SimpleCookie and using it in SELECT query

I posted a question yesterday :
Redirect python script to another python script for validation of login credentials
after i was done with that bit, i had another problem related to cookies. I sent the cookies in the header from the python script code:
#Create Cookie
C= Cookie.SimpleCookie()
#take the value of usernameLogin into the variable username
username= form.getvalue('usernameLogin')
#Set-Cookie header with the usernameLogin key
C['usernameLogin'] = username
this code is in the previous python script validate.py
i want to send the cookies to the next script page1.py
this is my code for page1.py :
import cgi
import cgitb
import sqlite3
import Cookie
import os
user_name=""
user_id=""
useridDb=""
resultid=""
resultname=""
idUser=""
if os.environ.has_key("HTTP_COOKIE"):
C= Cookie.SimpleCookie(os.environ.get("HTTP_COOKIE",""))
if C.has_key("usernameLogin"):
user_name= C['usernameLogin'].value
print user_name
form= cgi.FieldStorage()
cgitb.enable()
#Open connection
conn= sqlite3.connect("manager.db")
page1head= """
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Excursions</title>
<link rel='stylesheet' type='text/css' href='/page1.css/' />
<script lang="javascript" type="text/javascript" src="/suggestions.js/"> </script>
</head><body>
<div id="container">
<div id="header">
<h1>Field Note Manager</h1>
<p class="description">Observe...Record...Save!</p>
</div>
<!-- Content Section -->
<div id="wrapper">
<!-- Main Content Section -->
<div id="content">
<h2>Excursions</h2>
<table CELLPADDING="10" ><tr><th> <strong> Location </strong> </th><th> <strong> Date </strong> </th> <th> Time </th></tr>"""
page2head="""</table>
</div>
</div>
<!-- Logout Section -->
<div id="navigation">
<input type="hidden" name="greeting"/>
<form action="http://localhost:8000/cgi-bin/logout.py">
<p><input type="submit" name="logoutBtn" value="Logout" /> </p>
</form>
</div>
<!-- Extra Section for Queries -->
<div id="extra">
<h2>Quick Links</h2>
<dl> <dd><a href="http://localhost:8000/cgi-bin/query.py"/>Query the Database</a> </dd></dl>
<dl> <dd><a href="http://localhost:8000/cgi-bin/addFieldNote.py"/>Add Field Note</a> </dd></dl>
</div>
<!-- Footer -->
<div id="footer">
<p>Copyright 42578647, 2012</p>
</div>
</div>
"""
page1foot= """
</body>
</html>
"""
print "Content_type: text/html\n\n"
print page1head
#print excursion details
cur=conn.cursor()
resultid= cur.execute("SELECT userid FROM login WHERE username=?",[user_name])
cur.fetchone()
for data in resultid:
idUser= int(data)
resultname= cur.execute("""SELECT location,excurDate,excurTime FROM excursion WHERE user=?""",[idUser])
cur.fetchall()
for record in resultname:
print"<tr><td>",record[0],"</td><td>",record[1],"</td><td>",record[2],"</td></tr>"
print page2head
print page1foot
It prints the page, but no queries are generated. Is it because the cookie has not been retrieved and parsed or is there some problem with the SELECT statement?
I found out the answer. The cookies had not been set before the header in the previous validate.py

How to bypass Mechanize "AmbiguityError" in Python

I am trying to upload images to ImageBam by filling its web-forms and requesting POST.
I don't know too much about urllib2, httplib, multipart stuff. I am trying to use MECHANIZE module
But I think it shouldn't be too complex because it is just a web form, I will fill it and post it.
The page, where upload forms are:
http://www.imagebam.com/basic-upload
The form I am trying to fill:
<form name='form' id='form' enctype="multipart/form-data" method="post" action="/sys/upload/save">
<table align="center">
<tr>
<td>
01: <input type="file" name="file[]" size="30"><br>
02: <input type="file" name="file[]" size="30"><br>
03: <input type="file" name="file[]" size="30"><br>
04: <input type="file" name="file[]" size="30"><br>
05: <input type="file" name="file[]" size="30"><br>
also I saw a guy created an app using python;
http://sourceforge.net/projects/pymguploader/files/pymguploader/2011-12-24/
I want to write something like that, but much more basic of course.
anyway, here is my problem;
when I execute these;
import mechanize
a=mechanize.Browser()
a.open("http://www.imagebam.com/basic-upload")
forms=mechanize.ParseResponse(response)
a.select_form(nr=0)
dosya=open("file path...","r")
everything works fine I think.
also
print a
gives this output:
<Browser visiting http://www.imagebam.com/basic-upload
selected form:
<form POST http://www.imagebam.com/sys/upload/save multipart/form-data
<FileControl(file[]=<No files added>)>
<FileControl(file[]=<No files added>)>
<FileControl(file[]=<No files added>)>
<FileControl(file[]=<No files added>)>
<SelectControl(content_type=[*x, 1, 0])>
<SelectControl(thumb_size=[*100, 150, 180, 250, 300, 350])>
<SelectControl(thumb_aspect_ratio=[crop, *resize])>
<SelectControl(thumb_file_type=[gif, *jpg])>
<CheckboxControl(thumb_info=[1])>
<CheckboxControl(gallery_options=[*1])>>
>
but when I
a["file[]"]=dosya
the error is;
Traceback (most recent call last):
File "<pyshell#46>", line 1, in <module>
a["file[]"]=dosya
File "build\bdist.win32\egg\mechanize\_form.py", line 2780, in __setitem__
control = self.find_control(name)
File "build\bdist.win32\egg\mechanize\_form.py", line 3101, in find_control
return self._find_control(name, type, kind, id, label, predicate, nr)
File "build\bdist.win32\egg\mechanize\_form.py", line 3183, in _find_control
raise AmbiguityError("more than one control matching "+description)
AmbiguityError: more than one control matching name 'file[]'
How can I solve this problem?
SOLVED
Solution:
a.add_file(dosya,"filename",nr=0)
that automatically searches type=file inputs and adds my file to first one(nr=0 provides it)
New Problem
After I sending POST data (or I think it sends)
This page comes as a response;
<?xml version='1.0' encoding='utf-8'?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://developers.facebook.com/schema/" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="ImageBam.com" />
<meta name="description" content="Free Image Hosting and photo sharing. Create an online album with bulk upload tools and share with family and friends." />
<meta name="keywords" content="image hosting, free image hosting, photo sharing, upload photo, free photo gallery, photo host, image gallery" />
<meta name="robots" content="follow" />
<meta name="revisit-after" content="1 days" />
<meta property="fb:admins" content="3433880" />
<link rel="stylesheet" href="http://www.imagebam.com/style.css" type="text/css" />
<link rel="shortcut icon" href="http://www.imagebam.com/favicon.ico" />
<title>Fast, Free Image Hosting - ImageBam</title>
<script type="text/javascript" src="http://www.imagebam.com/JS/imagebam.js"></script>
<script type="text/javascript" src="http://www.imagebam.com/JS/pt.js"></script>
</head>
<body>
<!-- IMAGEBAM HEADER -->
<div class="scrollme">
<div class="abody">
<!-- everything -->
<div class="banner cursor" style="float:left;" onclick='top.location="http://www.imagebam.com"'></div>
<div style="float:right; text-align:right; border:0px solid #f2f2f2; border-top:none; padding-top: 5px; padding-left:3px; padding-right:10px;">
</div>
<div style="clear:left;"></div>
<div class="dtab">
<ul>
<li class="inactive">Multi-Upload</li>
<li class="inactive">Zip-Upload</li>
<li class="inactive">Basic Upload</li>
<li class="inactive">Learn More</li>
<li class="inactive">FAQ</li>
<li class="inactive">Register</li>
<li class="inactive">Login</li>
<li class="inactive">Premium</li>
</ul>
</div><br />
<!-- Google Code for Imagebam Uploaded Image Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
function img404(ID,fsrc){
document.getElementById('thumb_404_info').style.display="block";
document.getElementById("img_"+ID).style.display = "none";
document.getElementById("alt_"+ID).style.display = "inline";
setTimeout("reloadImg("+ID+",'"+fsrc+"')", 500);
}
function reloadImg(ID,fsrc){
mrand = Math.random();
document.getElementById("img_"+ID).style.display = "inline";
document.getElementById("alt_"+ID).style.display = "none";
document.getElementById("img_"+ID).src = fsrc+"?"+mrand;
}
/* ]]> */
</script>
<div class="box_wait" style="text-align:center; display:none;" id="thumb_404_info">Thumbnails that are being processed in the background might not load right away.<br /></div>
<div style="text-align:center; margin-bottom:5px;">
<b>NEW!</b> VideoBam.com (HD Video Hosting)
</div>
<fieldset><legend><img src="/img/icons/photos.png" alt="" style="vertical-align:middle; line-height:16px; height:16px; padding-right:5px;" /> All at Once</legend>
<table style="width:100%;"><tr>
<td>
<b>BB-Code</b><br />
<textarea onclick="this.select();" style="width:300px; height:200px;"></textarea>
</td>
<td>
<b>HTML-Code</b><br />
<textarea onclick="this.select();" style="width:300px; height:200px;"></textarea>
</td>
</tr>
</table>
</fieldset>
<!--
<fieldset><legend style='color:green;'><img src='/img/icons/new.png' alt='' style='vertical-align:middle; line-height:16px; height:16px; padding-right:5px;'> NEW! ImageBam Remote Upload Widget</legend>
<b>Webmasters / Mods!</b><br> Allow your users to upload images to ImageBam <b>without leaving your website or forum!</b><br> Add our new ImageBam Remote Upload Widget to you website!<br>
Please spread the word! Thank you!
</fieldset>
-->
<div style="text-align:center; margin-bottom:5px;">
<b>NEW!</b> VideoBam.com (HD Video Hosting)
</div>
<fieldset><legend><img src="/img/icons/delete.png" alt="" style="vertical-align:middle; line-height:16px; height:16px; padding-right:5px;" /> All Removal Links</legend>
Do not share the links below. You can use them to delete the photos you have uploaded.<br />
<textarea onclick="this.select()" style="width:600px; height:200px;"></textarea>
</fieldset>
<!-- Google Code for Imagebam Uploaded Image Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1068053810;
var google_conversion_language = "en_US";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "6tqpCPa-chCy6qT9Aw";
var google_conversion_value = 0;
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1068053810/?label=6tqpCPa-chCy6qT9Aw&guid=ON&script=0" />
</div>
</noscript>
</div>
<div class="footer">
<a class="footera" href="http://www.imagebam.com/">ImageBam</a> | <a class="footera" href="/remote-upload-widget">Remote Upload Widget</a> | <a class="footera" href="http://www.imagebam.com/screengrab_upload_firefox_extension">screengrab tool</a> | <a class="footera" href="http://www.imagebam.com/terms-of-service">terms of service</a> | <a class="footera" href="http://www.imagebam.com/frequently-asked-questions">help</a> | <a class="footera" href="http://support.imagebam.com" target="_blank">support forums</a> | <a class="footera" href="http://code.google.com/p/imagebam-api/">API for developers</a> | <a class="footera" href="http://www.imagebam.com/report-abuse">report abuse</a>
<div style="height:35px; overflow:hidden;">
<div id="google_translate_element" style="margin-top:9px;"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit" type="text/javascript"></script>
</div>
<div style="text-align:center; color:#999; margin-top:10px;">
<table style="margin:auto;"><tr><td><img src="http://1.imagebam.com/static/img/tux.png" alt="tux" /></td><td>Powered by dedicated Linux servers. Flixya Entertainment, LLC © 2010</td></tr></table>
</div>
</div>
</div>
<div id="updater_index"></div>
<script type="text/javascript">
</script>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2424497-2";
urchinTracker();
</script>
</body>
</html>
Normally, it is the after-uploading page that comes out with image's links etc.
But I think there is a dynamic process, because the links were not prepared when I got the page.
Am I missing something? because even if you dont fill the inputs on form, if you submit() it, it redirects you to that after-uploading page..
Use select_control() also with nr=0 to select the first file.

Categories

Resources