I am trying to use selenium from python to scrape some dynamics pages with javascript. However, I cannot call firefox after I followed the instruction of selenium on the pyp
This is already in the comment of OP's question, but to lay it out as an answer. You can have Selenium run in the background without opening an actual browser window.
For example, if you use Chrome, set these options:
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.set_headless(headless=True)
Then when you call your web driver, your settings become a parameter:
browser = webdriver.Chrome(chrome_options=chrome_options)