Patent attributes
Methods and systems are presented for automatically detecting positions of various webpage elements within a webpage when the webpage is rendered, based on analyzing the programming code of the webpage. A position detection system obtains and parses the programming code of the webpage to identify webpage elements within the webpage. A group of related webpage elements is identified based on a shared programming structure. The position detection system generates a DOM tree based on the programming code, and determines relative positions of the webpage elements within the group by traversing the DOM tree using a breadth-first search algorithm.