fix : change browser waiting check

This commit is contained in:
martin legrand 2025-04-16 10:08:03 +02:00
parent 906dc18060
commit 26421190b1
4 changed files with 11 additions and 13 deletions

View File

@ -58,6 +58,7 @@ services:
- "3000:3000"
volumes:
- ./frontend/agentic-seek/src:/app/src
- ./screenshots:/app/screenshots
environment:
- NODE_ENV=development
- CHOKIDAR_USEPOLLING=true # Ensure file watching works in Docker

View File

@ -40,8 +40,7 @@ function App() {
const fetchScreenshot = async () => {
try {
const res = await axios.get('http://0.0.0.0:8000/screenshots/updated_screen.png', {
responseType: 'blob',
params: { t: new Date().getTime() }
responseType: 'blob'
});
if (isMounted) {
console.log('Screenshot fetched successfully');

View File

@ -1,8 +1,9 @@
fastapi==0.115.12
uvicorn==0.34.0
pydantic==2.10.6
pydantic_core==2.27.2
fastapi>=0.115.12
uvicorn>=0.34.0
pydantic>=2.10.6
pydantic_core>=2.27.2
setuptools>=75.6.0
sacremoses>=0.0.53
requests>=2.31.0
numpy>=1.24.4
colorama>=0.4.6

View File

@ -153,11 +153,10 @@ class Browser:
try:
initial_handles = self.driver.window_handles
self.driver.get(url)
wait = WebDriverWait(self.driver, timeout=30)
wait = WebDriverWait(self.driver, timeout=10)
wait.until(
lambda driver: (
driver.execute_script("return document.readyState") == "complete" and
not any(keyword in driver.page_source.lower() for keyword in ["checking your browser", "verifying", "captcha"])
not any(keyword in driver.page_source.lower() for keyword in ["checking your browser", "captcha"])
),
message="stuck on 'checking browser' or verification screen"
)
@ -591,12 +590,10 @@ if __name__ == "__main__":
driver = create_driver(headless=False, stealth_mode=True)
browser = Browser(driver, anticaptcha_manual_install=True)
#browser.go_to("https://github.com/Fosowl/agenticSeek")
#txt = browser.get_text()
#print(txt)
#browser.go_to("https://practicetestautomation.com/practice-test-login/")
input("press enter to continue")
print("AntiCaptcha / Form Test")
#browser.go_to("https://practicetestautomation.com/practice-test-login/")
#txt = browser.get_text()
#browser.go_to("https://www.google.com/recaptcha/api2/demo")
browser.go_to("https://home.openweathermap.org/users/sign_up")
inputs_visible = browser.get_form_inputs()