mechanize-python

    1熱度

    2回答

    所以我現在有這樣的代碼來讀取accounts.txt文件看起來像這樣: username1:password1 username2:password2 username3:password3 然後我有這個(感謝這裏的會員)閱讀accounts.txt文件並將其拆分爲用戶名和密碼,以便日後打印。當我嘗試印刷線1的用戶名和口令,此代碼: with open('accounts.txt') as

    0熱度

    1回答

    我剛開始着眼於今天的Mechanize Python版本。我從http://wwwsearch.sourceforge.net/mechanize/的第一個示例中獲取了大部分代碼。這個模塊的文檔非常稀疏,我不知道如何調試。 我試圖找到並按照文本「職業」的第一個鏈接。當我運行這個時,我得到這個錯誤「mechanize._mechanize.LinkNotFoundError」。誰能告訴我我做錯了什麼

    21熱度

    3回答

    我下載與機械化和響應報頭有一個字符串文件: Content-Disposition: attachment; filename=myfilename.txt 有沒有得到該文件名值快速標準的方式? 我心目中現在是這樣的: filename = f[1]['Content-Disposition'].split('; ')[1].replace('filename=', '') 但它看起來像一

    1熱度

    1回答

    以下代碼: #!/usr/bin/env python import mechanize class MechanizeSubclass(mechanize.Browser): def __init__(self, factory=None, history=None,

    10熱度

    2回答

    我想選擇一個機械化的窗體。這是我的代碼: br = mechanize.Browser() self.br.open(url) br.select_form(name="login_form") 形式的代碼: <form id="login_form" onsubmit="return Index.login_submit();" method="post" action="index.p

    0熱度

    1回答

    我的一個腳本在XP系統上完美運行,但確切的腳本掛在2003系統上。我總是用機械化來發送HTTP請求,這裏有一個例子: import socket, mechanize, urllib, urllib2 socket.setdefaulttimeout(60) #### No idea why it's not working MechBrowser = mechanize.Browser(

    0熱度

    2回答

    下面的形式: <p><label for="version_id">Version</label> <select id="version_id" name="version_id"><option></option> <option value="value1">2.1.1</option> <option value="value2">2.1.2</option> <option va

    0熱度

    1回答

    嘗試機械化以從https asp網站上刪除某些內容,看起來好像登錄頁面提交工作正常,因爲我返回了200.但是當我嘗試打開一個可能使用cookie的url時在登錄後被捕獲,我被重新定向回到登錄頁面,並顯示我的會話已過期的錯誤。最後一個打印只是讓我可以看到我重定向。 import mechanize USER_AGENT = "Mozilla/5.0 (X11; U; Linux i686; tr

    3熱度

    1回答

    我正在與圖書管理員合作,重新組織他的數碼攝影檔案。 我已經構建了一個Python機器人Mechanize和BeautifulSoup來從一個集合中抽取大約7000個結構性很差且溫和的不正確/不完整的文檔。數據將被格式化爲電子表格,他可以用它來糾正它。現在,我總共猜測7500個HTTP請求來構建搜索字典,然後收集數據,不計算代碼中的錯誤和遺漏,隨着項目的進展,還有更多。 我認爲我可以提出這些請求的速

    2熱度

    3回答

    我正在嘗試登錄到login.live.com,但機械化不會識別該頁面上有表單。有沒有人有什麼建議? br=mechanize.Browser() br.open('https://login.live.com/') br.select_form(nr=0) 這導致: mechanize._mechanize.FormNotFoundError: no form matching nr 0