def get_trade_receipt(self, trade_id: str) -> list: html = self._session.get( "https://steamcommunity.com/trade/{}/receipt".format( trade_id)).content.decode() items = [] for item in texts_between(html, "oItem = ", ";\r\n\toItem"): items.append(json.loads(item)) return items
def test_texts_between(self): text = "<li>element 1</li>\n<li>some random element</li>" items = [] for el in utils.texts_between(text, "<li>", "</li>"): items.append(el) self.assertEquals(items, ["element 1", "some random element"])
def test_texts_between(self): text = "<li>element 1</li>\n<li>some random element</li>" items = [] for el in utils.texts_between(text, "<li>", "</li>"): items.append(el) self.assertEquals(items, ["element 1", "some random element"])
def get_trade_receipt(self, trade_id: str) -> list: html = self._session.get("https://steamcommunity.com/trade/{}/receipt".format(trade_id)).content.decode() items = [] for item in texts_between(html, "oItem = ", ";\r\n\toItem"): items.append(json.loads(item)) return items