Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6058965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:39:29+00:00 2026-05-23T08:39:29+00:00

First and foremost, I am writing a python script to automate purchasing of certain

  • 0

First and foremost, I am writing a python script to automate purchasing of certain domains from dreamhost.com. I first go to the website’s panel where users can do pretty much anything the site has to offer. Here is the code:

br = mechanize.Browser()
br.open("https://panel.dreamhost.com/index.cgi?tree=domain.registration&")
br.select_form(name="a")
br["username"]="my_username_here"
br["password"]="my_password_here"
br.submit()

This code words perfectly and logs me into the panel. From here, there is a textbox to enter your domain and a multi-select to choose your extension – when this form is submitted, it checks for availability.

I take a similar approach to the success above and perform the following:

br.select_form(name="f")
br["Pick Domain Name"] = "domainiwanttobuy"    #textbox
br["tld"] = [extension list]                   #select from dropdown
br.submit()

The resulting HTML after this form has been submitted shows that the dropdown changes appropriately, but the text field is blank and I get an error from dreamhost that says, “Error: Please enter a domain name above.”

So the input field isn’t working – I looked at the corresponding page source HTML and here it is:

<input name="fqdn" id="fqdn" class="text reg_domain_input" name="Pick Domain Name" value="mynewdomain" onChange="tradeMarkCheck(this.id)">

First of all it’s suspect that there are 2 name elements. I cannot use the name=”fqdn” or it says that such a control doesn’t exist. Secondly, I see that a javascript function is called when the value changes. I’m aware that mechanize cannot handle Javascript, but I don’t believe that the function does anything of value. So, I don’t think it’s causing the problem. Here is the corresponding javascript function:

<script type="text/javascript">
function tradeMarkCheck(x) {
    var domain = document.getElementById(x).value;
    var bad = /(dream.*host|host.*dream)/;

    if (bad.test(domain)) {
        alert("NOTE: Domains containing 'DreamHost' in them are not eligible for use with DreamHost Rewards.  Also, please ensure that your site/domain does not dilute or infringe upon the 'DreamHost' trademark (if you have any questions as to whether a use is legal or not, contact us at abuse@dreamhost.com).");
    }
}
</script>

I’ve spent hours debugging this and trying to get a workaround. Any ideas would be greatly appreciated. Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:39:30+00:00Added an answer on May 23, 2026 at 8:39 am

    I haven’t looked at the site but I strongly suspect that some javascript is doing something that you’re not doing with mechanize. The standard answer in these cases is to use Selenium Webdriver to automate a browser (it has a Python API).

    Edit:
    Selenium Webdriver has HtmlUnit headless browser that supports javascript a little, but it’s far from full javascript support. PhantomJS might be able to help you out, it’s a headless version of Webkit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

THE EXAMPLE First and foremost, here's my code and problem: http://www.nathanstpierre.com/MBX/showoff.html THE ISSUE So
First and foremost, I apologize for any vagueness in this question. At this point,
First and foremost let me state that I know that accessing server side controls
First and foremost, apologies for any cross-posting. Hope I'm not repeating an issue here,
First and foremost, I do not know RegEx but am trying to piece something
First and foremost. I'm totally new to programming in Excel. I'm trying to make
First and foremost thank you for checking out my problem, and for any help
I am first and foremost a perl coder, but like many, also code in
First and foremost: JSON and XML are not an option in this specific case,
First, let's get the security considerations out of the way. I'm using simple authentication

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.