from selenium import webdriver
from selenium.webdriver.firefox.options import Options
executable_path = "/usr/bin/geckodriver"
browser = webdriver.Firefox(executable_path=executable_path)
browser.get('http://google.com')
print(browser.current_url) ## here is your current url
我建议您使用Selenium Webdriver,因为它可以充当浏览器,使您能够轻松地执行用户操作,例如获取当前URL。下面是一个例子:
相关问题 更多 >
编程相关推荐