Hello again, my fellow programmers.
The end of the month of October is here and a fourth and final PR has to be made in order to fulfil the requirements of my 0.2 Release.I will keep this post short and sweet (again)... because it is Halloween and I have candy to eat... erhm give out O.o
So, this week as I mentioned above I had to complete my final PR for Hacktoberfest. I was stumped on what I actually wanted to do and contribute to as I was also pressed for time due to spending time on my ever growing open world concept level for my Game Dev. course. #ThanksGeorge
I searched and searched for something interesting to do with knowledge I already had. I then remembered that the point of each consecutive contribution was to learn something new. I remembered the Selenium/Python automation bot from my previous PR and saw that there was open issues the owner of the repo wanted help with. I picked one where I needed to scrape a phone number from a specific "open" chatroom in whatsapp web.
I got to work and I completely forgot about asking the maintainer to assign me to this problem, which I think is a big NO NO in Open Source Dev.
So, I thought that since I used selenium in my 0.1 release to scrape a web page for links using Java, it would be similar.
I mean it was not that different but the way the maintainer does the scraping is weird and I was not familiar with it. He finds/scrapes data by using the CSS selector class. Which I found to be an interesting approach, it is risky because whatsapp can change the layout and selector class and that can cause everything in the bot to break. But, I am not one to judge.
Nevertheless, I started searching how to scrape exactly what I was looking for:
- Use his already made function to Open a chat with a specific person
- Open the chat info
- Scrape the phone number from the person's info
- Close the chat room
- Return the scraped phone number
No comments:
Post a Comment