如何使用python.mechanize查找执行后AJAX页面重定向到的URL?

时间:2013-02-26 17:04:01

标签: python mechanize

执行AJAX页面代码后,浏览器将打开另一个URL(使用window.location.href指定)。如何使用mechanize获取它?

import mechanize
response = mechanize.urlopen(url)
return response.geturl()

会返回初始网址。

1 个答案:

答案 0 :(得分:2)

Mechanize不处理Javascript。请尝试使用Selenium代替

相关问题