Quick Python question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • illfuuptn
    SBR MVP
    • 03-17-10
    • 1860

    #1
    Quick Python question
    When I put in
    Code:
    from mechanize import browser
    I get
    Code:
         Traceback (most recent call last):
      File "<pyshell#1>", line 1, in <module>
        from mechanize import browser
    ImportError: cannot import name browser
    what am I doing wrong?
  • RickySteve
    Restricted User
    • 01-31-06
    • 3415

    #2
    You do realize this forum struggles greatly to only barely serve its own purpose, let alone technical coding discussion.
    Comment
    • JoeVig
      SBR Wise Guy
      • 01-11-08
      • 772

      #3
      "And now for something completely different..."

      Oh, wrong Python.
      Comment
      • Salmon Steak
        SBR MVP
        • 03-05-10
        • 2110

        #4
        the traceback is telling you what program file (pyshell#1) the error occured in, the line (1), and what line of code caused the error(from mechanize import browser). "Import error" is defining the reason, cannot import name browser. Don't know why. I am learning how to do python right now actually. If I read on how to help you more I will let you know. GL
        Comment
        • antifoil
          SBR MVP
          • 11-11-09
          • 3993

          #5
          here is a pro tip.

          go to some programming forum, create a username like programminggirl or the like, and use a pink font. for an added bonus put some anime girl as your avatar and use <3s. next, tell them what your problem is, but be really detailed as to what you are looking for and how to program is to work.

          those nerds will do the work for you and give you the result.
          Comment
          • bztips
            SBR Sharp
            • 06-03-10
            • 283

            #6
            Try using "Browser" instead of "browser" -- python distinguishes upper/lower cases
            Comment
            • acarmelo1
              SBR Hall of Famer
              • 09-29-09
              • 6321

              #7
              Originally posted by antifoil
              here is a pro tip.

              go to some programming forum, create a username like programminggirl or the like, and use a pink font. for an added bonus put some anime girl as your avatar and use <3s. next, tell them what your problem is, but be really detailed as to what you are looking for and how to program is to work.

              those nerds will do the work for you and give you the result.
              Best tip here so far <3
              Comment
              • uva3021
                SBR Wise Guy
                • 03-01-07
                • 537

                #8
                there is no function or class called browser in mechanize obv
                Comment
                • bztips
                  SBR Sharp
                  • 06-03-10
                  • 283

                  #9
                  Originally posted by uva3021
                  there is no function or class called browser in mechanize obv
                  No browser class, but there is a Browser class:

                  Comment
                  • uva3021
                    SBR Wise Guy
                    • 03-01-07
                    • 537

                    #10
                    well then "Browser" is the answer, hopefully OP awards you handsomely, sir
                    Comment
                    SBR Contests
                    Collapse
                    Top-Rated US Sportsbooks
                    Collapse
                    Working...