Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wait for page to be loaded while using UI browser automation
#1
Hi Dear Gintaras,

I seem to find a solution to determine if the webpage is loaded or not while using the UI automation. please see the pics. The state and desc will be changed once the page is finished to load. I tried many times, and it worked very well. Do you think will that be a judgment basis for waiting for page to be loaded or not? Thank you very much! 
[Image: xRsUKs5.png]
[Image: PPoZO9m.png]
[Image: OmqJeL8.png]
#2
I tried it, but not always works. For example with filecr.com, when opening pages without waiting, Chrome often does not change the Reload button. Did not test with Edge. In most cases this works.
#3
I tried the same thing with filecr.com with Edge and it worked very well. I will try it again with chrome when i get home. Thanks!
#4
Hi Gintaras,
Tested with chrome on my home computer and it still worked. Just a little difference than Edge but almost the same. 
[Image: vBk1VMb.jpg]
[Image: 6RgMBPE.jpg]
#5
Hi Dear Gintaras,

If this can be used as a basis for judgment, then it becomes very reliable to perform complex operations on web pages using UI automation, such as uploading, downloading, filling out forms, and a host of other operations. So how should the code be written? (I'm very interested in how far LA's potential really is?).Besides,If the vast majority of cases are useful, then why not write this wait page loading function inside the library?
PS:
Don't forget that if there is a problem with the network connection, the reloading button will not change if the network is down

Thanks a lot!
#6
With filecr.com this (now deleted) code failed in ~10% cases.

This new code works 100%:
https://www.libreautomate.com/forum/show...p?tid=7483
#7
Hi Gintaras, I have tested with Edge. And it can work perfectly! Thanks for the code!

Hi Gintaras, I tested 3 times with edge and nothing error occurred. Here is one of the proof! This is so cool! 
Code:
Copy      Help
Page 1 loaded in 839 ms
Page 2 loaded in 691 ms
Page 3 loaded in 586 ms
Page 4 loaded in 764 ms
Page 5 loaded in 720 ms
Page 6 loaded in 698 ms
Page 7 loaded in 820 ms
Page 8 loaded in 697 ms
Page 9 loaded in 706 ms
Page 10 loaded in 676 ms
Page 11 loaded in 605 ms
Page 12 loaded in 760 ms
Page 13 loaded in 595 ms
Page 14 loaded in 734 ms
Page 15 loaded in 809 ms
Page 16 loaded in 599 ms
Page 17 loaded in 732 ms
Page 18 loaded in 836 ms
Page 19 loaded in 586 ms
Page 20 loaded in 570 ms
Page 21 loaded in 718 ms
Page 22 loaded in 637 ms
Page 23 loaded in 660 ms
Page 24 loaded in 719 ms
Page 25 loaded in 705 ms
Page 26 loaded in 777 ms
Page 27 loaded in 707 ms
Page 28 loaded in 725 ms
Page 29 loaded in 667 ms
Page 30 loaded in 675 ms
Page 31 loaded in 657 ms
Page 32 loaded in 837 ms
Page 33 loaded in 852 ms
Page 34 loaded in 786 ms
Page 35 loaded in 638 ms
Page 36 loaded in 754 ms
Page 37 loaded in 698 ms
Page 38 loaded in 894 ms
Page 39 loaded in 698 ms
Page 40 loaded in 773 ms
Page 41 loaded in 760 ms
Page 42 loaded in 921 ms
Page 43 loaded in 701 ms
Page 44 loaded in 838 ms
Page 45 loaded in 755 ms
Page 46 loaded in 728 ms
Page 47 loaded in 707 ms
Page 48 loaded in 818 ms
Page 49 loaded in 678 ms
Page 50 loaded in 771 ms
Page 51 loaded in 666 ms
Page 52 loaded in 717 ms
Page 53 loaded in 683 ms
Page 54 loaded in 839 ms
Page 55 loaded in 912 ms
Page 56 loaded in 675 ms
Page 57 loaded in 870 ms
Page 58 loaded in 852 ms
Page 59 loaded in 904 ms
Page 60 loaded in 845 ms
Page 61 loaded in 877 ms
Page 62 loaded in 814 ms
Page 63 loaded in 743 ms
Page 64 loaded in 857 ms
Page 65 loaded in 895 ms
Page 66 loaded in 850 ms
Page 67 loaded in 844 ms
Page 68 loaded in 715 ms
Page 69 loaded in 830 ms
Page 70 loaded in 997 ms
Page 71 loaded in 875 ms
Page 72 loaded in 659 ms
Page 73 loaded in 936 ms
Page 74 loaded in 880 ms
Page 75 loaded in 771 ms
Page 76 loaded in 801 ms
Page 77 loaded in 817 ms
Page 78 loaded in 736 ms
Page 79 loaded in 852 ms
Page 80 loaded in 990 ms
Page 81 loaded in 728 ms
Page 82 loaded in 747 ms
Page 83 loaded in 791 ms
Page 84 loaded in 855 ms
Page 85 loaded in 726 ms
Page 86 loaded in 774 ms
Page 87 loaded in 701 ms
Page 88 loaded in 709 ms
Page 89 loaded in 848 ms
Page 90 loaded in 671 ms
Page 91 loaded in 805 ms
Page 92 loaded in 1041 ms
Page 93 loaded in 671 ms
Page 94 loaded in 781 ms
Page 95 loaded in 829 ms
Page 96 loaded in 768 ms
Page 97 loaded in 852 ms
Page 98 loaded in 1054 ms
Page 99 loaded in 714 ms
Page 100 loaded in 732 ms
Page 101 loaded in 916 ms
Page 102 loaded in 789 ms
Page 103 loaded in 958 ms
Page 104 loaded in 755 ms
Page 105 loaded in 650 ms
Page 106 loaded in 712 ms
Page 107 loaded in 761 ms
Page 108 loaded in 883 ms
Page 109 loaded in 737 ms
Page 110 loaded in 697 ms
Page 111 loaded in 889 ms
Page 112 loaded in 818 ms
Page 113 loaded in 754 ms
Page 114 loaded in 846 ms
Page 115 loaded in 750 ms
Page 116 loaded in 797 ms
Page 117 loaded in 858 ms
Page 118 loaded in 913 ms
Page 119 loaded in 792 ms
Page 120 loaded in 741 ms
Page 121 loaded in 793 ms
Page 122 loaded in 866 ms
Page 123 loaded in 881 ms
Page 124 loaded in 804 ms
Page 125 loaded in 827 ms
Page 126 loaded in 814 ms
Page 127 loaded in 708 ms
Page 128 loaded in 944 ms
Page 129 loaded in 722 ms
Page 130 loaded in 705 ms
Page 131 loaded in 855 ms
Page 132 loaded in 694 ms
Page 133 loaded in 683 ms
Page 134 loaded in 639 ms
Page 135 loaded in 836 ms
Page 136 loaded in 763 ms
Page 137 loaded in 754 ms
Page 138 loaded in 797 ms
Page 139 loaded in 880 ms
Page 140 loaded in 757 ms
Page 141 loaded in 833 ms
Page 142 loaded in 834 ms
Page 143 loaded in 756 ms
Page 144 loaded in 754 ms
Page 145 loaded in 755 ms
Page 146 loaded in 792 ms
Page 147 loaded in 789 ms
Page 148 loaded in 795 ms
Page 149 loaded in 835 ms
Page 150 loaded in 844 ms
Page 151 loaded in 962 ms
Page 152 loaded in 847 ms
Page 153 loaded in 674 ms
Page 154 loaded in 961 ms
Page 155 loaded in 734 ms
Page 156 loaded in 794 ms
Page 157 loaded in 788 ms
Page 158 loaded in 837 ms
Page 159 loaded in 884 ms
Page 160 loaded in 758 ms
Page 161 loaded in 769 ms
Page 162 loaded in 877 ms
Page 163 loaded in 834 ms
Page 164 loaded in 920 ms
Page 165 loaded in 708 ms
Page 166 loaded in 750 ms
Page 167 loaded in 759 ms
Page 168 loaded in 756 ms
Page 169 loaded in 751 ms
Page 170 loaded in 834 ms
Page 171 loaded in 789 ms
Page 172 loaded in 876 ms
Page 173 loaded in 762 ms
Page 174 loaded in 610 ms
Page 175 loaded in 839 ms
Page 176 loaded in 789 ms
Page 177 loaded in 751 ms
Page 178 loaded in 792 ms
Page 179 loaded in 916 ms
Page 180 loaded in 799 ms
Page 181 loaded in 755 ms
Page 182 loaded in 764 ms
Page 183 loaded in 795 ms
Page 184 loaded in 770 ms
Page 185 loaded in 799 ms
Page 186 loaded in 683 ms
Page 187 loaded in 1007 ms
Page 188 loaded in 863 ms
Page 189 loaded in 755 ms
Page 190 loaded in 646 ms
Page 191 loaded in 599 ms
Page 192 loaded in 606 ms
Page 193 loaded in 647 ms
Page 194 loaded in 687 ms
Page 195 loaded in 757 ms
Page 196 loaded in 754 ms
Page 197 loaded in 838 ms
Page 198 loaded in 835 ms
Page 199 loaded in 834 ms
Page 200 loaded in 838 ms
Page 201 loaded in 834 ms
Page 202 loaded in 967 ms
Page 203 loaded in 799 ms
Page 204 loaded in 932 ms
Page 205 loaded in 753 ms
Page 206 loaded in 932 ms
Page 207 loaded in 812 ms
Page 208 loaded in 931 ms
Page 209 loaded in 811 ms
Page 210 loaded in 684 ms
Page 211 loaded in 721 ms
Page 212 loaded in 1056 ms
Page 213 loaded in 803 ms
Page 214 loaded in 718 ms
Page 215 loaded in 878 ms
Page 216 loaded in 787 ms
Page 217 loaded in 834 ms
Page 218 loaded in 876 ms
Page 219 loaded in 792 ms
Page 220 loaded in 919 ms
Page 221 loaded in 931 ms
Page 222 loaded in 757 ms
Page 223 loaded in 836 ms
Page 224 loaded in 878 ms
Page 225 loaded in 831 ms
Page 226 loaded in 834 ms
Page 227 loaded in 914 ms
Page 228 loaded in 920 ms
Page 229 loaded in 966 ms
Page 230 loaded in 895 ms
Page 231 loaded in 886 ms
Page 232 loaded in 753 ms
Page 233 loaded in 760 ms
Page 234 loaded in 925 ms
Page 235 loaded in 847 ms
Page 236 loaded in 792 ms
Page 237 loaded in 878 ms
Page 238 loaded in 827 ms
Page 239 loaded in 966 ms
Page 240 loaded in 887 ms
Page 241 loaded in 845 ms
Page 242 loaded in 713 ms
Page 243 loaded in 919 ms
Page 244 loaded in 843 ms
Page 245 loaded in 920 ms
Page 246 loaded in 802 ms
Page 247 loaded in 792 ms
Page 248 loaded in 845 ms
Page 249 loaded in 835 ms
Page 250 loaded in 713 ms
Page 251 loaded in 761 ms
Page 252 loaded in 877 ms
Page 253 loaded in 829 ms
Page 254 loaded in 886 ms
Page 255 loaded in 799 ms
Page 256 loaded in 839 ms
Page 257 loaded in 789 ms
Page 258 loaded in 929 ms
Page 259 loaded in 855 ms
Page 260 loaded in 839 ms
Page 261 loaded in 1010 ms
Page 262 loaded in 796 ms
Page 263 loaded in 877 ms
Page 264 loaded in 715 ms
Page 265 loaded in 965 ms
Page 266 loaded in 840 ms
Page 267 loaded in 840 ms
Page 268 loaded in 750 ms
Page 269 loaded in 927 ms
Page 270 loaded in 892 ms
Page 271 loaded in 801 ms
Page 272 loaded in 883 ms
Page 273 loaded in 762 ms
Page 274 loaded in 979 ms
Page 275 loaded in 816 ms
Page 276 loaded in 756 ms
Page 277 loaded in 873 ms
Page 278 loaded in 835 ms
Page 279 loaded in 801 ms
Page 280 loaded in 838 ms
Page 281 loaded in 878 ms
Page 282 loaded in 957 ms
Page 283 loaded in 800 ms
Page 284 loaded in 795 ms
Page 285 loaded in 884 ms
Page 286 loaded in 917 ms
Page 287 loaded in 809 ms
Page 288 loaded in 833 ms
Page 289 loaded in 790 ms
Page 290 loaded in 873 ms
Page 291 loaded in 774 ms
Page 292 loaded in 920 ms
Page 293 loaded in 837 ms
Page 294 loaded in 922 ms
Page 295 loaded in 834 ms
Page 296 loaded in 758 ms
Page 297 loaded in 895 ms
Page 298 loaded in 876 ms
Page 299 loaded in 876 ms
Page 300 loaded in 879 ms
Page 301 loaded in 920 ms
Page 302 loaded in 818 ms
Page 303 loaded in 1024 ms
Page 304 loaded in 927 ms
Page 305 loaded in 917 ms
Page 306 loaded in 753 ms
Page 307 loaded in 788 ms
Page 308 loaded in 798 ms
Page 309 loaded in 872 ms
Page 310 loaded in 879 ms
Page 311 loaded in 838 ms
Page 312 loaded in 879 ms
Page 313 loaded in 792 ms
Page 314 loaded in 836 ms
Page 315 loaded in 965 ms
Page 316 loaded in 883 ms
Page 317 loaded in 837 ms
Page 318 loaded in 916 ms
Page 319 loaded in 792 ms
Page 320 loaded in 879 ms
Page 321 loaded in 806 ms
Page 322 loaded in 790 ms
Page 323 loaded in 877 ms
Page 324 loaded in 1007 ms
Page 325 loaded in 854 ms
Page 326 loaded in 885 ms
Page 327 loaded in 883 ms
Page 328 loaded in 917 ms
Page 329 loaded in 892 ms
Page 330 loaded in 713 ms
Page 331 loaded in 922 ms
Page 332 loaded in 875 ms
Page 333 loaded in 922 ms
Page 334 loaded in 831 ms
Page 335 loaded in 833 ms
Page 336 loaded in 800 ms
Page 337 loaded in 922 ms
Page 338 loaded in 889 ms
Page 339 loaded in 921 ms
Page 340 loaded in 919 ms
Page 341 loaded in 792 ms
Page 342 loaded in 797 ms
Page 343 loaded in 882 ms
Page 344 loaded in 789 ms
Page 345 loaded in 833 ms
Page 346 loaded in 840 ms
Page 347 loaded in 801 ms
Page 348 loaded in 837 ms
Page 349 loaded in 849 ms
Page 350 loaded in 797 ms
Page 351 loaded in 883 ms
Page 352 loaded in 712 ms
Page 353 loaded in 932 ms
Page 354 loaded in 851 ms
Page 355 loaded in 880 ms
Page 356 loaded in 877 ms
Page 357 loaded in 937 ms
Page 358 loaded in 839 ms
Page 359 loaded in 879 ms
Page 360 loaded in 770 ms
Page 361 loaded in 805 ms
Page 362 loaded in 837 ms
Page 363 loaded in 925 ms
Page 364 loaded in 839 ms
Page 365 loaded in 921 ms
Page 366 loaded in 924 ms
Page 367 loaded in 962 ms
Page 368 loaded in 925 ms
Page 369 loaded in 716 ms
Page 370 loaded in 918 ms
Page 371 loaded in 1063 ms
Page 372 loaded in 844 ms
Page 373 loaded in 881 ms
Page 374 loaded in 833 ms
Page 375 loaded in 879 ms
Page 376 loaded in 833 ms
Page 377 loaded in 968 ms
Page 378 loaded in 933 ms
Page 379 loaded in 841 ms
Page 380 loaded in 762 ms
Page 381 loaded in 892 ms
Page 382 loaded in 922 ms
Page 383 loaded in 757 ms
Page 384 loaded in 919 ms
Page 385 loaded in 923 ms
Page 386 loaded in 852 ms
Page 387 loaded in 832 ms
Page 388 loaded in 924 ms
Page 389 loaded in 934 ms
Page 390 loaded in 839 ms
Page 391 loaded in 875 ms
Page 392 loaded in 1236 ms
Page 393 loaded in 837 ms
Page 394 loaded in 832 ms
Page 395 loaded in 2723 ms
Page 396 loaded in 973 ms
Page 397 loaded in 1020 ms
Page 398 loaded in 839 ms
Page 399 loaded in 1060 ms
Page 400 loaded in 804 ms
Page 401 loaded in 846 ms
Page 402 loaded in 916 ms
Page 403 loaded in 852 ms
Page 404 loaded in 754 ms
Page 405 loaded in 882 ms
Page 406 loaded in 794 ms
Page 407 loaded in 973 ms
Page 408 loaded in 892 ms
Page 409 loaded in 925 ms
Page 410 loaded in 878 ms
Page 411 loaded in 872 ms
Page 412 loaded in 971 ms
Page 413 loaded in 880 ms
Page 414 loaded in 806 ms
Page 415 loaded in 1004 ms
Page 416 loaded in 935 ms
Page 417 loaded in 888 ms
Page 418 loaded in 1013 ms
Page 419 loaded in 888 ms
Page 420 loaded in 838 ms
Page 421 loaded in 964 ms
Page 422 loaded in 841 ms
Page 423 loaded in 846 ms
Page 424 loaded in 841 ms
Page 425 loaded in 793 ms
Page 426 loaded in 1006 ms
Page 427 loaded in 876 ms
Page 428 loaded in 877 ms
Page 429 loaded in 848 ms
Page 430 loaded in 849 ms
Page 431 loaded in 789 ms
Page 432 loaded in 833 ms
Page 433 loaded in 754 ms
Page 434 loaded in 931 ms
Page 435 loaded in 970 ms
Page 436 loaded in 808 ms
Page 437 loaded in 881 ms
Page 438 loaded in 834 ms
Page 439 loaded in 880 ms
Page 440 loaded in 879 ms
Page 441 loaded in 835 ms
Page 442 loaded in 835 ms
Page 443 loaded in 963 ms
Page 444 loaded in 924 ms
Page 445 loaded in 839 ms
Page 446 loaded in 795 ms
Page 447 loaded in 794 ms
Page 448 loaded in 796 ms
Page 449 loaded in 834 ms
Page 450 loaded in 754 ms
Page 451 loaded in 919 ms
Page 452 loaded in 754 ms
Page 453 loaded in 873 ms
Page 454 loaded in 793 ms
Page 455 loaded in 919 ms
Page 456 loaded in 830 ms
Page 457 loaded in 844 ms
Page 458 loaded in 881 ms
Page 459 loaded in 836 ms
Page 460 loaded in 922 ms
Page 461 loaded in 790 ms
Page 462 loaded in 833 ms
Page 463 loaded in 877 ms
Page 464 loaded in 804 ms
Page 465 loaded in 965 ms
Page 466 loaded in 975 ms
Page 467 loaded in 968 ms
Page 468 loaded in 966 ms
Page 469 loaded in 978 ms
Page 470 loaded in 1020 ms
Page 471 loaded in 1064 ms
Page 472 loaded in 1016 ms
Page 473 loaded in 1026 ms
Page 474 loaded in 802 ms
Page 475 loaded in 966 ms
Page 476 loaded in 962 ms
Page 477 loaded in 850 ms
Page 478 loaded in 970 ms
Page 479 loaded in 889 ms
Page 480 loaded in 837 ms
Page 481 loaded in 926 ms
Page 482 loaded in 937 ms
Page 483 loaded in 916 ms
Page 484 loaded in 874 ms
Page 485 loaded in 838 ms
Page 486 loaded in 882 ms
Page 487 loaded in 884 ms
Page 488 loaded in 922 ms
Page 489 loaded in 904 ms
Page 490 loaded in 1021 ms
Page 491 loaded in 929 ms
Page 492 loaded in 880 ms
Page 493 loaded in 1009 ms
Page 494 loaded in 1106 ms
Page 495 loaded in 923 ms
Page 496 loaded in 965 ms
Page 497 loaded in 841 ms
Page 498 loaded in 877 ms
Page 499 loaded in 881 ms
Page 500 loaded in 1055 ms
Page 501 loaded in 926 ms
Page 502 loaded in 845 ms
Page 503 loaded in 838 ms
Page 504 loaded in 914 ms
Page 505 loaded in 918 ms
Page 506 loaded in 793 ms
Page 507 loaded in 831 ms
Page 508 loaded in 972 ms
Page 509 loaded in 795 ms
Page 510 loaded in 876 ms
Page 511 loaded in 838 ms
Page 512 loaded in 917 ms
Page 513 loaded in 834 ms
Page 514 loaded in 919 ms
Page 515 loaded in 965 ms
Page 516 loaded in 739 ms
Page 517 loaded in 918 ms
Page 518 loaded in 771 ms
Page 519 loaded in 2929 ms
Page 520 loaded in 765 ms
Page 521 loaded in 798 ms
Page 522 loaded in 871 ms
Page 523 loaded in 834 ms
Page 524 loaded in 963 ms
Page 525 loaded in 812 ms
Page 526 loaded in 809 ms
Page 527 loaded in 791 ms
Page 528 loaded in 755 ms
Page 529 loaded in 756 ms
Page 530 loaded in 1009 ms
Page 531 loaded in 804 ms
Page 532 loaded in 791 ms
Page 533 loaded in 846 ms
Page 534 loaded in 833 ms
Page 535 loaded in 792 ms
Page 536 loaded in 832 ms
Page 537 loaded in 717 ms
Page 538 loaded in 919 ms
Page 539 loaded in 761 ms
Page 540 loaded in 792 ms
Page 541 loaded in 832 ms
Page 542 loaded in 832 ms
Page 543 loaded in 717 ms
Page 544 loaded in 791 ms
Page 545 loaded in 758 ms
Page 546 loaded in 833 ms
Page 547 loaded in 926 ms
Page 548 loaded in 1016 ms
Page 549 loaded in 740 ms
Page 550 loaded in 840 ms
Page 551 loaded in 797 ms
Page 552 loaded in 792 ms
Page 553 loaded in 873 ms
Page 554 loaded in 968 ms
Page 555 loaded in 760 ms
Page 556 loaded in 836 ms
Page 557 loaded in 841 ms
Page 558 loaded in 679 ms
Page 559 loaded in 797 ms
Page 560 loaded in 838 ms
Page 561 loaded in 918 ms
Page 562 loaded in 944 ms
Page 563 loaded in 871 ms
Page 564 loaded in 815 ms
Page 565 loaded in 931 ms
Page 566 loaded in 842 ms
Page 567 loaded in 797 ms
Page 568 loaded in 836 ms
Page 569 loaded in 876 ms
Page 570 loaded in 3387 ms
Page 571 loaded in 866 ms
Page 572 loaded in 923 ms
Page 573 loaded in 801 ms
Page 574 loaded in 753 ms
Page 575 loaded in 803 ms
Page 576 loaded in 841 ms
Page 577 loaded in 3215 ms
Page 578 loaded in 812 ms
Page 579 loaded in 794 ms
Page 580 loaded in 848 ms
Page 581 loaded in 834 ms
Page 582 loaded in 794 ms
Page 583 loaded in 921 ms
Page 584 loaded in 884 ms
Page 585 loaded in 917 ms
Page 586 loaded in 787 ms
Page 587 loaded in 817 ms
Page 588 loaded in 891 ms
Page 589 loaded in 765 ms
Page 590 loaded in 883 ms
Page 591 loaded in 938 ms
Page 592 loaded in 937 ms
Page 593 loaded in 783 ms
Page 594 loaded in 874 ms
Page 595 loaded in 856 ms
Page 596 loaded in 895 ms
Page 597 loaded in 771 ms
Page 598 loaded in 800 ms
Page 599 loaded in 860 ms
Page 600 loaded in 798 ms
Page 601 loaded in 930 ms
Page 602 loaded in 885 ms
Page 603 loaded in 1011 ms
Page 604 loaded in 850 ms
Page 605 loaded in 851 ms
Page 606 loaded in 972 ms
Page 607 loaded in 925 ms
Page 608 loaded in 921 ms
Page 609 loaded in 833 ms
Page 610 loaded in 839 ms
Page 611 loaded in 1063 ms
Page 612 loaded in 886 ms
Page 613 loaded in 832 ms
Page 614 loaded in 924 ms
Page 615 loaded in 801 ms
Page 616 loaded in 881 ms
Page 617 loaded in 791 ms
Page 618 loaded in 879 ms
Page 619 loaded in 835 ms
Page 620 loaded in 755 ms
Page 621 loaded in 846 ms
Page 622 loaded in 884 ms
Page 623 loaded in 791 ms
Page 624 loaded in 796 ms
Page 625 loaded in 835 ms
Page 626 loaded in 756 ms
Page 627 loaded in 751 ms
Page 628 loaded in 879 ms
Page 629 loaded in 836 ms
Page 630 loaded in 876 ms
Page 631 loaded in 755 ms
Page 632 loaded in 968 ms
Page 633 loaded in 877 ms
Page 634 loaded in 755 ms
Page 635 loaded in 880 ms
Page 636 loaded in 757 ms
Page 637 loaded in 845 ms
Page 638 loaded in 879 ms
Page 639 loaded in 875 ms
Page 640 loaded in 912 ms
Page 641 loaded in 755 ms
Page 642 loaded in 964 ms
Page 643 loaded in 890 ms
Page 644 loaded in 925 ms
Page 645 loaded in 805 ms
Page 646 loaded in 836 ms
Page 647 loaded in 875 ms
Page 648 loaded in 754 ms
Page 649 loaded in 802 ms
Page 650 loaded in 873 ms
Page 651 loaded in 754 ms
Page 652 loaded in 879 ms
Page 653 loaded in 726 ms
Page 654 loaded in 832 ms
Page 655 loaded in 928 ms
Page 656 loaded in 842 ms
Page 657 loaded in 835 ms
Page 658 loaded in 753 ms
Page 659 loaded in 759 ms
Page 660 loaded in 968 ms
Page 661 loaded in 764 ms
Page 662 loaded in 756 ms
Page 663 loaded in 831 ms
Page 664 loaded in 753 ms
Page 665 loaded in 759 ms
Page 666 loaded in 875 ms
Page 667 loaded in 929 ms
Page 668 loaded in 887 ms
Page 669 loaded in 756 ms
Page 670 loaded in 891 ms
Page 671 loaded in 882 ms
Page 672 loaded in 832 ms
Page 673 loaded in 914 ms
Page 674 loaded in 874 ms
Page 675 loaded in 879 ms
Page 676 loaded in 793 ms
Page 677 loaded in 875 ms
Page 678 loaded in 881 ms
Page 679 loaded in 795 ms
Page 680 loaded in 886 ms
Page 681 loaded in 712 ms
Page 682 loaded in 793 ms
Page 683 loaded in 884 ms
Page 684 loaded in 923 ms
Page 685 loaded in 976 ms
Page 686 loaded in 934 ms
Page 687 loaded in 895 ms
Page 688 loaded in 802 ms
Page 689 loaded in 837 ms
Page 690 loaded in 836 ms
Page 691 loaded in 798 ms
Page 692 loaded in 811 ms
Page 693 loaded in 756 ms
Page 694 loaded in 888 ms
Page 695 loaded in 924 ms
Page 696 loaded in 840 ms
Page 697 loaded in 968 ms
Page 698 loaded in 1020 ms
Page 699 loaded in 725 ms
Page 700 loaded in 876 ms
Page 701 loaded in 876 ms
Page 702 loaded in 974 ms
Page 703 loaded in 977 ms
Page 704 loaded in 895 ms
Page 705 loaded in 842 ms
Page 706 loaded in 843 ms
Page 707 loaded in 838 ms
Page 708 loaded in 836 ms
Page 709 loaded in 755 ms
Page 710 loaded in 803 ms
Page 711 loaded in 929 ms
Page 712 loaded in 878 ms
Page 713 loaded in 803 ms
Page 714 loaded in 845 ms
Page 715 loaded in 3106 ms
Page 716 loaded in 836 ms
Page 717 loaded in 838 ms
Page 718 loaded in 932 ms
Page 719 loaded in 877 ms
Page 720 loaded in 714 ms
Page 721 loaded in 807 ms
Page 722 loaded in 1013 ms
Page 723 loaded in 805 ms
Page 724 loaded in 721 ms
Page 725 loaded in 3362 ms
Page 726 loaded in 802 ms
Page 727 loaded in 3351 ms
Page 728 loaded in 717 ms
Page 729 loaded in 795 ms
Page 730 loaded in 875 ms
Page 731 loaded in 876 ms
Page 732 loaded in 920 ms
Page 733 loaded in 796 ms
Page 734 loaded in 925 ms
Page 735 loaded in 878 ms
Page 736 loaded in 1010 ms
Page 737 loaded in 1060 ms
Page 738 loaded in 899 ms
Page 739 loaded in 840 ms
Page 740 loaded in 756 ms
Page 741 loaded in 796 ms
Page 742 loaded in 875 ms
Page 743 loaded in 847 ms
Page 744 loaded in 799 ms
Page 745 loaded in 795 ms
Page 746 loaded in 1013 ms
Page 747 loaded in 1024 ms
Page 748 loaded in 849 ms
Page 749 loaded in 915 ms
Page 750 loaded in 759 ms
Page 751 loaded in 846 ms
Page 752 loaded in 765 ms
Page 753 loaded in 807 ms
Page 754 loaded in 832 ms
Page 755 loaded in 878 ms
Page 756 loaded in 874 ms
Page 757 loaded in 879 ms
Page 758 loaded in 833 ms
Page 759 loaded in 959 ms
Page 760 loaded in 928 ms
Page 761 loaded in 770 ms
Page 762 loaded in 848 ms
Page 763 loaded in 836 ms
Page 764 loaded in 920 ms
Page 765 loaded in 798 ms
Page 766 loaded in 756 ms
Page 767 loaded in 886 ms
Page 768 loaded in 832 ms
Page 769 loaded in 874 ms
Page 770 loaded in 920 ms
Page 771 loaded in 795 ms
Page 772 loaded in 846 ms
Page 773 loaded in 880 ms
Page 774 loaded in 755 ms
Page 775 loaded in 874 ms
Page 776 loaded in 966 ms
Page 777 loaded in 3204 ms
Page 778 loaded in 932 ms
Page 779 loaded in 815 ms
Page 780 loaded in 802 ms
Page 781 loaded in 916 ms
Page 782 loaded in 3293 ms
Page 783 loaded in 883 ms
Page 784 loaded in 809 ms
Page 785 loaded in 806 ms
Page 786 loaded in 838 ms
Page 787 loaded in 792 ms
Page 788 loaded in 975 ms
Page 789 loaded in 793 ms
Page 790 loaded in 878 ms
Page 791 loaded in 718 ms
Page 792 loaded in 880 ms
Page 793 loaded in 805 ms
Page 794 loaded in 836 ms
Page 795 loaded in 931 ms
Page 796 loaded in 1021 ms
Page 797 loaded in 887 ms
Page 798 loaded in 916 ms
Page 799 loaded in 837 ms
Page 800 loaded in 891 ms
Page 801 loaded in 880 ms
Page 802 loaded in 803 ms
Page 803 loaded in 881 ms
Page 804 loaded in 765 ms
Page 805 loaded in 841 ms
Page 806 loaded in 730 ms
Page 807 loaded in 802 ms
Page 808 loaded in 793 ms
Page 809 loaded in 794 ms
Page 810 loaded in 756 ms
Page 811 loaded in 753 ms
Page 812 loaded in 796 ms
Page 813 loaded in 838 ms
Page 814 loaded in 835 ms
Page 815 loaded in 925 ms
Page 816 loaded in 848 ms
Page 817 loaded in 975 ms
Page 818 loaded in 898 ms
Page 819 loaded in 880 ms
Page 820 loaded in 798 ms
Page 821 loaded in 715 ms
Page 822 loaded in 837 ms
Page 823 loaded in 792 ms
Page 824 loaded in 911 ms
Page 825 loaded in 877 ms
Page 826 loaded in 798 ms
Page 827 loaded in 759 ms
Page 828 loaded in 798 ms
Page 829 loaded in 717 ms
Page 830 loaded in 877 ms
Page 831 loaded in 838 ms
Page 832 loaded in 879 ms
Page 833 loaded in 790 ms
Page 834 loaded in 962 ms
Page 835 loaded in 725 ms
Page 836 loaded in 880 ms
Page 837 loaded in 689 ms
Page 838 loaded in 838 ms
Page 839 loaded in 790 ms
Page 840 loaded in 1071 ms
Page 841 loaded in 886 ms
Page 842 loaded in 848 ms
Page 843 loaded in 754 ms
#8
Here with Edge results are the same as with Chrome. Unreliable.

Also I updated the ChromePage class code. Now it can be used with Chrome and Edge, without editing.
#9
Testing video. Never fails
#10
The "open URL" code was wrong. This version works 100% with filecr.com, but I did not test with other websites.

The code now here:
https://www.libreautomate.com/forum/show...p?tid=7483
#11
This works great for me!Thanks for the updates! I am going to do more testing.
#12
Hi Dear Gintaras,

I Tested this code with about 10 sites with thousands of record for each site and never got a fail.I believe this code is reliable enough.
#13
https://www.libreautomate.com/forum/show...p?tid=7483
#14
Hi Dear Gintaras, 
This code doesn't work since opened the first link. Could you please help me out?
Thanks! 
Code:
Copy      Help
// script "Notes-box.com.cs"
//.
script.setup(trayIcon: true, sleepExit: true, exitKey: KKey.MediaStop, pauseKey: KKey.MediaPlayPause);
//..

var w = wnd.find(0, "* - Google Chrome", "Chrome_WidgetWin_1");
var p = new ChromePage(w);

foreach (var e in w.Elm["web:GROUPING", prop: "@style=display: block;"]["LINK"].FindAll()) {
    p.Open(e.Value);
    500.ms();
}



/// <summary>
///
Opens a web page in Chrome or Edge, and waits until loaded.
/// </summary>
public class ChromePage {
    wnd _w;
    elm _eAddress, _eReload;
    
    //may need to change these strings. They may depend on your computer's language and browser program version.
    ///
    public static string AddressBarName = "Address and search bar";
    
    ///
    public static string ReloadButtonName = "**m Reload||Refresh"; //Chrome||Edge
    
    ///
    public static string ReloadButtonDescription = "**m Reload this page||Refresh (Ctrl+R)";
    
    /// <summary>
    ///
Finds UI elements for later opening a URL and waiting.
    /// </summary>
    ///
<param name="w">Chrome or Edge window.</param>
    public ChromePage(wnd w) {
        _w = w;
        var e = _w.Elm["TOOLBAR"].Find(1);
        _eAddress = e.Elm["TEXT", AddressBarName].Find(1);
        _eReload = e.Elm["BUTTON", ReloadButtonName].Find(1);
    }

    
    /// <summary>
    ///
Opens a web page and waits until loaded or stopped.
    /// Also activates the browser window and makes the address bar focused.
    /// </summary>
    ///
<param name="url">Web page URL.</param>
    ///
<param name="secondsTimeout">How long to wait until loaded. The same as with most other "wait for" functions of the automation library (0 infinite, negative no exception).</param>
    ///
<returns>false if timeout (when <i>secondsTimeout</i> negative).</returns>
    ///
<exception cref="TimeoutException"></exception>
    ///
<exception cref="Exception">Exceptions of used functions.</exception>
    public bool Open(string url, double secondsTimeout = 60) {
        wildex desc = ReloadButtonDescription;
        _w.Activate();
        _eAddress.Focus(); //must be before setting Value
        _eAddress.Value = url;
        _w.Send(0x100, (int)KKey.Enter); //WM_KEYDOWN
        _w.Send(0x101, (int)KKey.Enter); //WM_KEYUP
        100.ms();
        return wait.forCondition(secondsTimeout, () => desc.Match(_eReload.Description));
    }
}

I was planning to extract every music genre in Categories and then create folders for each album and musician then download pdf. I stuck at the square one.  Big Grin
#15
After opening another web page, elms of old page usually become invalid. Nee to get all URLs to array.

Code:
Copy      Help
foreach (var url in w.Elm["web:GROUPING", prop: "@style=display: block;"]["LINK"].FindAll().Select(o => o.Value).ToArray()) {
    p.Open(url);
    500.ms();
}

Not tested.
#16
Works like a magic! Big Grin  Thank you so much!


Forum Jump:


Users browsing this thread: 1 Guest(s)