vendredi 27 mars 2015

Reading from html page that needs cookies passed and form data


I am writing a program in java in order to practice tough coding problems and learn more.


Program description The program reads first names from a text file one by one, then enters them into facebook search bar, and WITHOUT hitting enter, it sees who the first person is that pops up(when you type a name into facebook searchbar people drop down) and takes the name and stores it into a text file. Aka it sees which people are the first result for a list of a bunch of names.


The problem I am having with this is 2 fold.



  1. the search option on facebook isnt avalible unless you are logged in, meaning the cookies for the log in session would need to be passed else facebook.com just reads its home login page.

  2. the search bar needs the name entered into it in order for the results to drop down and apear in the source code/element info, I am especially unsure how to do this part since it seems like a special form of query since you arnt really submiting it, its just typed and results apear even before you hit search. (like googles recommend search feature)


Does anyone have any code examples or references to code examples that would help explain how to go about doing either or both of these 2 things. Have been stuck for a long time, thanks.





Aucun commentaire:

Enregistrer un commentaire