I'm trying to do automated tests on a localhost site using the following settings:
Python 3.8.10
selenium 3.141.0
Firefox 90.0
Burp Suite Community Edition v2021.6.2
I'm using Burp proxy with the address 127.0.0.1:8080.
I tested several examples available here. The below code is the one that has worked best so far.
from selenium import webdriver
firefox_capabilities = webdriver.DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True
PROXY = "127.0.0.1:8080"
firefox_capabilities['proxy'] = {
"proxyType": "MANUAL",
"httpProxy": PROXY,
"sslProxy": PROXY
}
driver = webdriver.Firefox(capabilities=firefox_capabilities)
driver.get("http://127.0.0.1")
This code works fine when the url in driver.get("URL here") is not localhost. When I enter the url http://127.0.0.1, the access made by selenium does not appear in Burp Suite's HTTP history. Instead of the accessed url, "http://detectportal.firefox.com" appears.
Is this a problem in the code or some configuration that I need to do?