I am trying to run a “webcrawler” that impersonates a profile I have in my “host” machine. This profile contains a google session that would allow me to make requests to the site. It also copies the cookies and other tokens; the program works fine in my machine. The problem is that I don’t know how to pass it to the firefox instance running inside the container.
The scripts are based in Python, using Selenium and GeckoDriver. The container is very simple:
FROM python:3.11.8-slim
WORKDIR /app
RUN apt-get update && apt-get install firefox-esr -y
# Install Python packages
RUN pip install selenium webdriver_manager
ENV DISPLAY=:0
# Copy Python script
COPY main.py .
CMD ["python", "main.py"]
- I tried to search for the location where profiles are stored to no success.
- I have also tried to “bruteforce” the program to tell me where the profiles are stored by loading
about:profiles
but the site tells me there has been a problem loading profiles and that I should try to reload firefox.
Camilo Torres Mestra is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.