问题标签 [robobrowser]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
337 浏览

python - Using robobrowser on ASP.net website

I have been working on this for couple days now. Can not really find how to make this work. I am fairly new to aspx websites and fetching information out of them.

I am trying to login/authenticate on a website that uses aspx pages. So I followed this thread which really helped me get this in motion. (Last Answer)

Following those directions, I write:

This is the outcome of that print statement:

So it is obvious that I am retrieving the information correctly. Now I have 3 input fields:

Which I can use in the following manner:

My only problem is the last field btnSubmit which I do not know how to input a value since this is of the following type:

when I submit on the website, using the Chrome Tools I get the following outcome:

Where basically the x,y positions are where I clicked on the page. Really do not know how to do this request through Python. Used this to no avail.

0 投票
2 回答
441 浏览

python-3.x - 使用 Robobrowser、Python 中的 Beautifulsoup 在 HTML 文件中提取没有标签/格式的文本

我在一个凌乱的页面中有这个 HTML。我想提取每个</b>和之间的元素<br>。它们是纯文本,没有我可以使用的有用类或 ID。

到目前为止我使用的代码:

这导致

被打印出来。这是一个好的开始,但由于某种原因,我无法获得更多要打印的元素?

有没有办法只提取一段特定的文本?例如金色文字 4706 / 5315 ?

我在python 3.6中使用robobrowser,beautifulsoup

0 投票
0 回答
153 浏览

python-3.x - Robobrowser 登录表单提交不成功或不正确

似乎这应该可以正常工作。尝试过序列化和非序列化。确保表单类是正确的。需要登录,但是get_links()提交表单后什么都不返回。有任何想法吗?

0 投票
1 回答
870 浏览

javascript - 有没有办法在 robobrowser 中激活 javascript?

我写了一个python脚本来提交表单,当我尝试它时,它不起作用..

所以我想看看 robobrowser 中的当前页面,我发现了这个:

它是法语的,但基本上,它需要激活 javascript ...

我试图找到一种在 robobrowser 中激活 javascript 的方法,但我没有找到任何解决方案......

所以..这是我的问题:有没有办法做到这一点?

感谢帮助。

0 投票
1 回答
396 浏览

python - 用 Python 填写动态在线表格

我正在使用 Python 上的 RoboBrowser,我正在尝试在网站上填写表格(此处)。现在的问题是表单是动态的。如果您打开链接,您会看到一行“国家”、“州/区”、“城市”和“位置”。

州/地区行取决于您从下拉菜单中选择的国家/地区,城市取决于州/地区,位置取决于城市。我希望能够为国家/地区的特定价值提取例如州/地区的“价值”。例如,当我编写以下代码时:

现在我想做的是获得form['state'].valuewith的所有可能值form['country'].value = '1'(因为状态列表取决于国家/地区的值)。我该怎么做呢?

感谢您阅读我的问题。

0 投票
0 回答
704 浏览

python - robobrowser 'NoneType' 对象不支持项目分配

我在登录时需要帮助,但它总是引发异常

0 投票
1 回答
163 浏览

python - Robobrowser 开发人员代码抛出错误“对象不可下标”?

所以我收到了这个错误......我回到文档并从开发人员那里找到了类似的代码。我复制并粘贴了它,它抛出了同样的错误。

这是开发人员的代码。有什么变化??TypeError:“NoneType”对象不可下标

谢谢

...我发现基本上您不能通过标识符指定特定表单...不知道为什么会这样..您可以 get_forms 并执行 len 并迭代,但这并不是那么好。这对其他人有用还是我只是一个完整的rube?

0 投票
1 回答
144 浏览

forms - 无法使用 robobrowser 操作表单中的输入

我已经在这里待了一天。没有一个 Youtube 视频超出了一个非常基本的示例。请帮忙。我敢肯定我在这里错过了一些非常基本的东西。

如果输入框嵌入到表格中,它会改变吗?这是我的代码:

这是错误:

0 投票
1 回答
179 浏览

python-3.x - 使用 Python 3 和 RoboBrowser 向 facebook 提交表单并获取 UnicodeDecodeError

因此,我正在尝试制作一个脚本,该脚本将使用 RoboBrowser 为我自动将图像上传到 facebook,以浏览 mbasic.facebook.com 网站,并且在提交图像表单时出现一个奇怪的错误:

为什么会这样?我猜这与我如何处理将图像文件提交到表单有关,但我不知道为什么。我的相关代码如下:

编辑:
我不相信这是UnicodeDecodeError: 'charmap' codec can't decode byte X in position Y: character maps to 因为我没有读取代码中的任何文件,错误似乎在提交表单时出现. 无论如何,我已经看过这篇文章,但我无法弄清楚如何使用它来解决我的问题。

0 投票
2 回答
359 浏览

python - python正确获取网站登陆页面html

我一直在尝试使用 Robobrowser获取此页面的 html 内容“ https://webcache.gmc-uk.org/gmclrmp_enu/start.swe ”。这是代码:

我从中得到的是:

应该给我的是这样的:

所以我的意思是我实际上无法进入登录页面。有人可以帮我到达那里吗?谢谢!