Improvements in listing page URL generation.
This commit is contained in:
parent
a61fac72f7
commit
e939d67467
1 changed files with 9 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ import datetime
|
|||
from time import sleep
|
||||
from bs4 import BeautifulSoup
|
||||
import re
|
||||
from random import randint
|
||||
from random import randint, choice
|
||||
import mysql.connector
|
||||
from core.mysql_wrapper import get_anunciosdb, get_tasksdb
|
||||
from core.config import monthly_new_ads_target, working_hours
|
||||
|
|
@ -210,7 +210,13 @@ class Explorer:
|
|||
root = "https://www.idealista.com/"
|
||||
type = Explorer.ad_types[str(randint(1, 2))]
|
||||
city = "barcelona"
|
||||
page_number = str(randint(1, 30))
|
||||
page_number = str(randint(1, 45))
|
||||
order_string = choice(
|
||||
[
|
||||
"?ordenado-por=fecha-publicacion-asc",
|
||||
"?ordenado-por=fecha-publicacion-desc",
|
||||
]
|
||||
)
|
||||
url = (
|
||||
root
|
||||
+ type
|
||||
|
|
@ -222,6 +228,7 @@ class Explorer:
|
|||
+ "pagina-"
|
||||
+ page_number
|
||||
+ ".htm"
|
||||
+ order_string
|
||||
)
|
||||
|
||||
return url
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue