#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2017
    Posts
    221
    Rep Power
    1

    How To Code In Php 7 To NAVIGATE, WAIT FOR ITEM ELEMENTS, TYPE CONSTANT, CLICK BUTTON


    Fellow Php Developers,

    Googled but no luck to get Php 7 sample snippets for my learning purpose.
    Can you be kind enough to give me code snippets in Php 7 so I can learn Php 7 faster while gaining work experience building scripts ?
    I have tailored (but not built) a script with a variety of functions. If I can get the source code of the script (build it or get it built) then I can learn many functions from it. Good work experience! The task of the script is to auto search keywords on google. Here are the steps the script must undergo:

    PSEUDOCODE START

    * -> NAVIGATE TO (CONSTANT): google.com
    * -> WAIT FOR SEARCH BOX HTML ATTRIBUTE TO LOAD ON PAGE
    * -> WAIT FOR SEARCH BUTTON HTML ATTRIBUTE TO LOAD ON PAGE

    * -> TYPE KEYWORDS (CONSTANT): "php 7 programming forums" ON SEARCH BOX
    * -> CLICK SEARCH BUTTON


    (LOOP WHILE NOT LIST ITEMS IN LIST "SEARCH RESULT" = 100
    START LOOP
    * -> WAIT FOR SERP LINKS TO LOAD ON PAGE
    * -> SCRAPE ALL SERP LINKS (fullhrefs) TO LIST: SEARCH RESULT
    * -> CLICK NEXT BUTTON
    END LOOP
    )

    END OF PSEUDOCODE


    As you can see, The PSEUDOCODE has about 10 functions and so just glancing over the script should give me work experience in 10 things (teach me 10 different codes).

    So basically, hen you load the auto-search.php, it should redirect you to google.com, keyword search for "php 7 programming forums" and scrape all links presented by the search (page after page until 100 links have been scraped).
    Show me different code samples so I can learn a variety of ways to achieve the same goal.


    Anyway, using that PSEUDOCODE I built a .exe tool (Ubot Studio). Now, I want to learn how to build a web version. The first 10 people who provide codes here where their codes do all the steps mentioned in the PSEUDOCODE will get a free copy of the .exe version as a thank you and so NO you won't be wasting your time helping me learn Php 7 through practical work experience as you'll get something in return! And don't forget other newbies would benefit from your code contributions too and LIKE your posts!


    Thank You!
  2. #2
  3. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,278
    Rep Power
    2039
    Not going to write it for you (wheres the learning in that??) but you should look at some of the CURL functions for getting the data, and then the dom functions for parsing it.

    Just remember that PHP is server-side, and doesn't have any sort of gui functionality. That means that you can't see what's happening in the background, you can't see when an element is loaded, and all that you'll see is a list of URL's that are output along with any other messages that you want to output for yourself.

    PHP: cURL - Manual
    PHP: DOMDocument - Manual

    Comments on this post

    • UniqueIdeaMan agrees : Thank you for pointing out CURL.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2015
    Posts
    50
    Rep Power
    2
    I have tailored (but not built) a script with a variety of functions. If I can get the source code of the script (build it or get it built) then I can learn many functions from it. Good work experience!
    Wow, I need to expand my resume, then...

    The task of the script is to auto search keywords on google.
    Fwiw, Google has a limit on things like this.

    With that said, Google has fairly good documentation.

    The first 10 people who provide codes here where their codes do all the steps mentioned in the PSEUDOCODE will get a free copy of the .exe version as a thank you
    No thank you. I can build my own software. All while my labor is not being exploited.
  6. #4
  7. Forgotten Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,187
    Rep Power
    9644
    Ooh, yeah, bots are no good. Especially not when the thing you're trying to bot has more legitimate methods available.

    oakleaf pointed out the custom search documentation. That's what you need to use.

    Meanwhile questions about PHP that help you learn are fine. Like "how do I use this API" or "what does this code do". But they'll have to go in new threads.

IMN logo majestic logo threadwatch logo seochat tools logo