How spiders weave their webs