@@ -297,49 +297,70 @@ def highlight_with_js(driver, selector, loops, o_bs):
297
297
'0px 0px 6px 6px rgba(255, 0, 0, 1)';"""
298
298
% selector
299
299
)
300
- driver .execute_script (script )
300
+ try :
301
+ driver .execute_script (script )
302
+ except Exception :
303
+ return
301
304
time .sleep (0.0181 )
302
305
script = (
303
306
"""document.querySelector('%s').style.boxShadow =
304
307
'0px 0px 6px 6px rgba(128, 0, 128, 1)';"""
305
308
% selector
306
309
)
307
- driver .execute_script (script )
310
+ try :
311
+ driver .execute_script (script )
312
+ except Exception :
313
+ return
308
314
time .sleep (0.0181 )
309
315
script = (
310
316
"""document.querySelector('%s').style.boxShadow =
311
317
'0px 0px 6px 6px rgba(0, 0, 255, 1)';"""
312
318
% selector
313
319
)
314
- driver .execute_script (script )
320
+ try :
321
+ driver .execute_script (script )
322
+ except Exception :
323
+ return
315
324
time .sleep (0.0181 )
316
325
script = (
317
326
"""document.querySelector('%s').style.boxShadow =
318
327
'0px 0px 6px 6px rgba(0, 255, 0, 1)';"""
319
328
% selector
320
329
)
321
- driver .execute_script (script )
330
+ try :
331
+ driver .execute_script (script )
332
+ except Exception :
333
+ return
322
334
time .sleep (0.0181 )
323
335
script = (
324
336
"""document.querySelector('%s').style.boxShadow =
325
337
'0px 0px 6px 6px rgba(128, 128, 0, 1)';"""
326
338
% selector
327
339
)
328
- driver .execute_script (script )
340
+ try :
341
+ driver .execute_script (script )
342
+ except Exception :
343
+ return
329
344
time .sleep (0.0181 )
330
345
script = (
331
346
"""document.querySelector('%s').style.boxShadow =
332
347
'0px 0px 6px 6px rgba(128, 0, 128, 1)';"""
333
348
% selector
334
349
)
335
- driver .execute_script (script )
350
+ try :
351
+ driver .execute_script (script )
352
+ except Exception :
353
+ return
336
354
time .sleep (0.0181 )
337
355
script = """document.querySelector('%s').style.boxShadow =
338
356
'%s';""" % (
339
357
selector ,
340
358
o_bs ,
341
359
)
342
- driver .execute_script (script )
360
+ try :
361
+ driver .execute_script (script )
362
+ except Exception :
363
+ return
343
364
344
365
345
366
def highlight_with_jquery (driver , selector , loops , o_bs ):
@@ -751,28 +772,40 @@ def highlight_with_js_2(driver, message, selector, o_bs, msg_dur):
751
772
'0px 0px 6px 6px rgba(205, 30, 0, 1)';"""
752
773
% selector
753
774
)
754
- driver .execute_script (script )
775
+ try :
776
+ driver .execute_script (script )
777
+ except Exception :
778
+ return
755
779
time .sleep (0.0181 )
756
780
script = (
757
781
"""document.querySelector('%s').style.boxShadow =
758
782
'0px 0px 6px 6px rgba(128, 0, 128, 1)';"""
759
783
% selector
760
784
)
761
- driver .execute_script (script )
785
+ try :
786
+ driver .execute_script (script )
787
+ except Exception :
788
+ return
762
789
time .sleep (0.0181 )
763
790
script = (
764
791
"""document.querySelector('%s').style.boxShadow =
765
792
'0px 0px 6px 6px rgba(50, 50, 128, 1)';"""
766
793
% selector
767
794
)
768
- driver .execute_script (script )
795
+ try :
796
+ driver .execute_script (script )
797
+ except Exception :
798
+ return
769
799
time .sleep (0.0181 )
770
800
script = (
771
801
"""document.querySelector('%s').style.boxShadow =
772
802
'0px 0px 6px 6px rgba(50, 205, 50, 1)';"""
773
803
% selector
774
804
)
775
- driver .execute_script (script )
805
+ try :
806
+ driver .execute_script (script )
807
+ except Exception :
808
+ return
776
809
time .sleep (0.0181 )
777
810
778
811
try :
@@ -785,7 +818,10 @@ def highlight_with_js_2(driver, message, selector, o_bs, msg_dur):
785
818
selector ,
786
819
o_bs ,
787
820
)
788
- driver .execute_script (script )
821
+ try :
822
+ driver .execute_script (script )
823
+ except Exception :
824
+ return
789
825
790
826
791
827
def highlight_with_jquery_2 (driver , message , selector , o_bs , msg_dur ):
@@ -806,28 +842,40 @@ def highlight_with_jquery_2(driver, message, selector, o_bs, msg_dur):
806
842
'0px 0px 6px 6px rgba(205, 30, 0, 1)');"""
807
843
% selector
808
844
)
809
- driver .execute_script (script )
845
+ try :
846
+ driver .execute_script (script )
847
+ except Exception :
848
+ return
810
849
time .sleep (0.0181 )
811
850
script = (
812
851
"""jQuery('%s').css('box-shadow',
813
852
'0px 0px 6px 6px rgba(128, 0, 128, 1)');"""
814
853
% selector
815
854
)
816
- driver .execute_script (script )
855
+ try :
856
+ driver .execute_script (script )
857
+ except Exception :
858
+ return
817
859
time .sleep (0.0181 )
818
860
script = (
819
861
"""jQuery('%s').css('box-shadow',
820
862
'0px 0px 6px 6px rgba(50, 50, 200, 1)');"""
821
863
% selector
822
864
)
823
- driver .execute_script (script )
865
+ try :
866
+ driver .execute_script (script )
867
+ except Exception :
868
+ return
824
869
time .sleep (0.0181 )
825
870
script = (
826
871
"""jQuery('%s').css('box-shadow',
827
872
'0px 0px 6px 6px rgba(50, 205, 50, 1)');"""
828
873
% selector
829
874
)
830
- driver .execute_script (script )
875
+ try :
876
+ driver .execute_script (script )
877
+ except Exception :
878
+ return
831
879
time .sleep (0.0181 )
832
880
833
881
try :
@@ -837,7 +885,10 @@ def highlight_with_jquery_2(driver, message, selector, o_bs, msg_dur):
837
885
pass
838
886
839
887
script = """jQuery('%s').css('box-shadow', '%s');""" % (selector , o_bs )
840
- driver .execute_script (script )
888
+ try :
889
+ driver .execute_script (script )
890
+ except Exception :
891
+ return
841
892
842
893
843
894
def get_scroll_distance_to_element (driver , element ):
0 commit comments