Offer methods

otodom.offer.get_month_num_for_string(value)

Map for polish month names

Parameters:value (str) – Month value
Returns:Month number
Return type:int

This method returns a link to a 3D walkaround view of the apartment.

Parameters:html_parser – a BeautifulSoup object
Return type:string
Returns:A 3D walkaround view of the apartment
otodom.offer.get_offer_additional_assets(html_parser)

This method returns information about the apartment’s additional assets.

Parameters:html_parser – a BeautifulSoup object
Return type:list(string)
Returns:A list containing the additional assets
otodom.offer.get_offer_address(html_parser)

This method returns the offer address.

Parameters:html_parser – a BeautifulSoup object
Return type:string
Returns:The offer address
otodom.offer.get_offer_apartment_details(html_parser)

This method returns detailed information about the apartment.

Parameters:html_parser – a BeautifulSoup object
Return type:list(dict)
Returns:A list containing dictionaries of details, for example {‘kaucja’: 1100 zł}
otodom.offer.get_offer_description(html_parser)

This method returns the apartment description.

Parameters:html_parser – a BeautifulSoup object
Return type:string
Returns:The apartment description
otodom.offer.get_offer_details(html_parser)

This method returns detailed information about the offer.

Parameters:html_parser – a BeautifulSoup object
Return type:list(dict)
Returns:A list of dictionaries containing information about the offer
otodom.offer.get_offer_facebook_description(html_parser)

This method returns the short standardized description used for the default facebook share message.

Parameters:html_parser – a BeautifulSoup object
Return type:string
Returns:The default facebook share message
otodom.offer.get_offer_floor(html_parser)

This method returns the floor on which the apartment is located.

Parameters:html_parser – a BeautifulSoup object
Return type:string
Returns:The floor number
otodom.offer.get_offer_geographical_coordinates(html_parser)

This method returns the geographical coordinates of the apartment.

Parameters:html_parser – a BeautifulSoup object
Return type:tuple(string)
Returns:A tuple containing the latitude and longitude of the apartment
otodom.offer.get_offer_information(url, context=None)

Scrape detailed information about an OtoDom offer.

Parameters:
  • url – a string containing a link to the offer
  • context – a dictionary(string, string) taken straight from the scrape.category.get_category()
Returns:

A dictionary containing the scraped offer details

otodom.offer.get_offer_ninja_pv(html_content)

This method returns the website’s ninjaPV json data as dict.

Parameters:html_content – a requests.response.content object
Return type:dict
Returns:ninjaPV data
otodom.offer.get_offer_phone_numbers(offer_id, cookie, csrf_token)

This method makes a request to the OtoDom API asking for the poster’s phone number(s) and returns it.

Parameters:
  • offer_id – string, taken from context, see the return section of scrape.category.get_category() for reference
  • cookie – string, see scrape.utils.get_cookie_from() for reference
  • csrf_token – string, see scrape.utils.get_csrf_token() for reference
Return type:

list(string)

Returns:

A list of phone numbers as strings (no spaces, no ‘+48’)

This method returns a list of links to photos of the apartment.

Parameters:html_parser – a BeautifulSoup object
Return type:list(string)
Returns:A list of links to photos of the apartment
otodom.offer.get_offer_poster_name(html_parser)

This method returns the poster’s name (and surname if available).

Parameters:html_parser – a BeautifulSoup object
Return type:string
Returns:The poster’s name
otodom.offer.get_offer_title(html_parser)

This method returns the offer title.

Parameters:html_parser – a BeautifulSoup object
Return type:string
Returns:The offer title
otodom.offer.get_offer_total_floors(html_parser, default_value='')

This method returns the maximal number of floors in the building.

Parameters:html_parser – a BeautifulSoup object
Return type:string
Returns:The maximal floor number

This method returns a link to a video of the apartment.

Parameters:html_parser – a BeautifulSoup object
Return type:string
Returns:A link to a video of the apartment
otodom.offer.parse_available_from(date)

Parses string date to unix timestamp

Parameters:date (str) – Date
Returns:Unix timestamp
Return type:int
otodom.offer.parse_date_to_timestamp(date)

Parses string date to unix timestamp

Parameters:date (str) – Date
Returns:Unix timestamp
Return type:int