My goal is to create a Facebook script that can automatically add all friends from my "Friend List" who are not already on my friend's list. However, the issue arises when there are mutual friends at the top of the list. I need the script to scroll down until it reaches the "Add Friend" button for new connections, and then proceed to click on it.
Since I am new to programming, I would appreciate detailed instructions on how to achieve this task. I understand that Java is typically used for this purpose, but could someone please explain how to implement this in Python?
Below is the initial code snippet:
root.get(targets_url) #targets_url refers to the link of the target friend list
time.sleep(10)
while True:
element = root.find_element_by_class_name('FriendRequestAdd').click()