retrieves urls matching a certain pattern and exports them to a text file