File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1515def main ():
1616 # Get API key from environment variable (optional - uses free tier if not set)
1717 api_key = os .environ .get ("SENTIENCE_API_KEY" )
18+
19+ # Use VPS IP directly if domain is not configured
20+ # Replace with your actual domain once DNS is set up: api_url="https://api.sentienceapi.com"
21+ api_url = os .environ .get ("SENTIENCE_API_URL" , "http://15.204.243.91:9000" )
1822
1923 try :
20- with SentienceBrowser (api_key = api_key , headless = False ) as browser :
24+ with SentienceBrowser (api_key = api_key , api_url = api_url , headless = False ) as browser :
2125 # Navigate to a page with grid layouts (e.g., product listings, article feeds)
22- browser .page .goto ("https://example.com/products " , wait_until = "domcontentloaded" )
26+ browser .page .goto ("https://example.com" , wait_until = "domcontentloaded" )
2327 time .sleep (2 ) # Wait for page to fully load
2428
2529 print ("=" * 60 )
2630 print ("Example 1: Show all detected grids" )
2731 print ("=" * 60 )
2832 # Show all grids (all in purple)
29- snap = snapshot (browser , SnapshotOptions (show_grid = True ))
33+ snap = snapshot (browser , SnapshotOptions (show_grid = True , use_api = True ))
3034 print (f"✅ Found { len (snap .elements )} elements" )
3135 print (" Purple borders appear around all detected grids for 5 seconds" )
3236 time .sleep (6 ) # Wait to see the overlay
You can’t perform that action at this time.
0 commit comments